LinkedIn v2 API: How can a ugcPost-URN be converted to a share URN?

Viewed 1958

The ugcPosts endpoint can be used to request a list of a posts that an organization has recently created using the following url template https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn%3Ali%3Aorganization%3A{org_id})&count=100&projection=(paging,elements*,elements(*(id~)))

The results include both shares and ugcPosts, while the shares-endpoint includes just the shares. Every share has an activity-URN, while this is missing for ugcPosts. There seems to be no way to resolve the ugcPost-URN to an activity-URN, which means a permalink can't be generated.

Does anyone have a solution for this issue?

1 Answers

I cannot help with getting the Activity-URN, but it is possible to get a permalink from the UGC-Post-URN, e.g.:

https://www.linkedin.com/feed/update/urn:li:ugcPost:6509167547709943808/

By the way, this seems to the same post as referred to via this Activity-URN:

https://www.linkedin.com/feed/update/urn:li:activity:6509167701120819200/

So while the UCG Posts does seem to have an Activity-URN, it seems to not be retrievable by fetching the UGC Posts endpoint. I'm not aware of any way to retrieve the Activity-URN by API, I just looked up this one on the website.

My guess is that the Activity-URN is somehow a legacy ID. You can find instructions to convert old IDs based on Activity-ID to Share-URNs in the documentation, but not the other way round (Migrate from Update Keys to Share URNs).

Related