Retrieving post data
To retrieve LinkedIn post data, include the st.openPost action in your workflow and set basicInfo to true. Here's an example:
Each example below has its Node SDK call in the Node tab, and the label over each completion says what that call returns.
Each example below has its Python SDK call in the Python tab, and the label over each completion says what that call returns.
Each example below has its CLI command in the CLI tab, and the label over each completion says what the command prints.
Workflow:
{
"actionType": "st.openPost",
"postUrl": "https://www.linkedin.com/posts/post1",
"basicInfo": true
}Completion:
Completion – result() returns its data in data, and a failed action in errors:
Completion – with --json the CLI prints its data as data, or the action's error:
{
"actionType": "st.openPost",
"success": true,
"data": {
"url": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789",
"activityUrn": "urn:li:activity:1234567890123456789",
"time": "2023-01-02T12:30:00Z",
"type": "original",
"author": {
"type": "person",
"name": "Example Person",
"urn": "urn:li:member:123456789",
"profileUrl": "https://www.linkedin.com/in/example-person",
"headline": "Product Marketing Lead",
"viewerState": { "connectionDegree": "2nd" }
},
"reposter": null,
"text": "Check out our latest product launch!",
"repostText": null,
"hashtags": ["product", "launch"],
"mentions": ["https://www.linkedin.com/company/example-company"],
"externalLinks": ["https://example.com/launch"],
"images": [
"https://static.linkedin.com/image1.jpg",
"https://static.linkedin.com/image2.jpg"
],
"documentSlides": [],
"hasVideo": false,
"videoThumbnail": null,
"hasPoll": false,
"reactionsCount": 27,
"commentsCount": 8,
"repostsCount": 12,
"viewerState": { "reaction": null, "isOwn": false }
}
}💡 If you want to react or comment on the opened post, use the following actions as children: st.reactToPost, st.commentOnPost.
This page provides examples of workflows and their completions. For detailed documentation on constraints, parameters, and possible results of specific actions, always refer to the corresponding action documentation pages.