Maq
Maq

Reputation: 21

How to get LinkedIn URN

I am trying to set up sharing of post via application.

As per doc - https://learn.microsoft.com/ru-ru/linkedin/consumer/integrations/self-serve/share-on-linkedin I have created an app. And I need to have a URN. But I cannot find in docs where from I can get URN. How can I define it? I couldn't find an aswered question like mine here.

Upvotes: 2

Views: 4354

Answers (2)

HARSHAD SAVLE
HARSHAD SAVLE

Reputation: 1

this is your urn "sub": "782bbtaQ", just paste value 782bbtaQ in the place of the urn

Upvotes: -1

Manumaagu
Manumaagu

Reputation: 21

I had the same issue and I found how to fix it.

You can use this to get the user information: https://learn.microsoft.com/es-es/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2#api-request-to-retreive-member-details

The returning json code looks like this:

{
        "sub": "782bbtaQ",
        "name": "John Doe",
        "given_name": "John",
        "family_name": "Doe",
        "picture": "https://media.licdn-ei.com/dms/image/C5F03AQHqK8v7tB1HCQ/profile-displayphoto-shrink_100_100/0/",
        "locale": "en-US",
        "email": "[email protected]",
        "email_verified": true
}

Here what you want is the "sub" field, that acts like the id to create the urn you need to post. Now you just have to follow the format: e.g - urn:li:person: + sub

One thing I had trouble with was the scope when authenticating the user. Pay attention to the scope required, here you can see what scope is needed: https://learn.microsoft.com/es-es/linkedin/consumer/integrations/self-serve/share-on-linkedin#authenticating-members

I hope you can solve the error!

Upvotes: 2

Related Questions