How can we get actual Video Url of LinkedIn Post and comments from LinkedIn API v2

2.8k Views Asked by At

While fetching post on LinkedIn profile, we are getting Digital Media Asset URN for Video and documents. What is a way to find actual URL of Video in API. We are using https://api.linkedin.com/v2/ugcPosts?q=authors. I tried to add projection with request, but it is not returning expected Url.

Projection: (paging,elements((author,created,distribution,firstPublishedAt,id,lastModified,lifecycleState,origin,specificContent(com.linkedin.ugc.ShareContent(,media((description,media((media(video~:playableStreams),thumbnails)),originalUrl,thumbnails)))),visibility)))

1

There are 1 best solutions below

0
On

The projection works if you don't use the bulk /ugcPosts?q=authors API and instead query the ugcPosts one at a time.

The following CURL command will get the video URL for a UGC Post.

curl -H "X-Restli-Protocol-Version: 2.0.0" -H "Authorization: Bearer apikey" "https://api.linkedin.com/v2/ugcPosts/urn%3Ali%3AugcPost%3A6595780832772792320?viewContext=AUTHOR&projection=(specificContent(com.linkedin.ugc.ShareContent(media(*(media~:playableStreams)))))"