Create direct url to LinkedIn company update
Asked Answered
H

3

13

I'm implementing a Compony newsfeed on a website and ran into the following problem. The LinkedIn API doesn't provide a direct URL to a company update. Looking at the LinkedIn site there are direct URL's and they're like this for example: https://www.linkedin.com/company/1441/comments?topic=5849556347070205952&type=U&scope=1441&stype=C&a=5uHW&goback=%2Ebzo_*1_*1_*1_*1_*1_*1_*1_1441

Trying stuff out it seems that the parameters topic, type, scope, stype and a are mandatory for the URL to work.. (goback is the only one that isn't).

Using the LinkedIn API with the Company updates call I'm able to buid the direct url, except for the a parameter. The value is always 4 (for me unexplainable) characters long.

Has anyone ever successfully build a direct URL to a company update or can someone maybe explain the a parameter or how to generate its value?

Herder answered 7/4, 2014 at 14:50 Comment(2)
How were you parsing out the topic id? I only see it as part of the updateKey in the response - need to play string games to extract it...Millibar
@Millibar yeah I indeed expect some string(split) games...Herder
D
21

Updated to new format

You can link directly to any update (company or user) using the following url:

https://www.linkedin.com/feed/update/urn:li:activity:[topic_id]

You can get [topic_id] by getting the last bit of the updateKey in the api response from Linkedin. When updateKey = UPDATE-c7352-6410848097894756353, your topic_id = 6410848097894756353.

In your example that would become https://www.linkedin.com/feed/update/urn:li:activity:5849556347070205952 which links directly to the specific update. The post is too old to work with the new link format


The url used to be

https://www.linkedin.com/nhome/updates/?topic=[topic_id]

Updated thanks to the comment from @sethpollack

Dispatch answered 9/12, 2014 at 13:36 Comment(1)
this URL scheme no longer works. the new one is: linkedin.com/feed/update/urn:li:activity:[topic_id]Rorrys
J
1

For anyone trying to get the topic id from the API response object (as already commented on the OP question), the topic id is the value after the last hyphen of the updateKey property, which can be used with @Daan answer:

"updateKey": "UPDATE-cXXXX-YYYYYYYYYYYYYYYYYY"

Direct URL:

https://www.linkedin.com/nhome/updates?topic=[YYYYYYYYYYYYYYYYYY]
Jaquesdalcroze answered 31/10, 2016 at 9:36 Comment(1)
Thanks man, I was trying to use the 'id' field but I didn't work. Thought the url from @Dispatch was obsolete! :PSchoolhouse
M
0

Using the URL format above, get the topic_id by opening the update in its own window/tab, look at the page source code in your browser and search for the string :activity: the long number after the string is the infamous topic_id

Monostrophe answered 4/1, 2016 at 23:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.