User id from LinkedIn

How do you get the user ID from the LinkedIn API. Not the vanity id from the URL, but the id that’s used in the share api

I couldn’t find any reliable method of doing so without the target user granting permission to an OAuth app first.

Scraping doesn’t work if the user’s profile is private/not publically visible.

2 Likes

So say it is for my profile (Which it is), could I use any of the LinkedIn modules to do this? As i think Make.coms LinkedIn OAuth permissions have the right visibility to do so.

Ive callled the GET https://api.linkedin.com/v2/me API (See screenshot of my set up)

but i get the following error:

Input bundle is as follows [
{
“url”: “https://api.linkedin.com/v2/me”,
“method”: “GET”
}
]

Which makes me think headers weren’t mapped to the request

Any ideas as i cant get an OAuth token with the permissions for the me endpoint and hoping there’s something obvious im missing here

I have all the right permissions in my LinkedIn Connection

image

This is not necessary… Would you kindly read carefully before responding.

Remove the root path of the API, i.e.:

cba26c8145b87c2ba5f75acb103f718e26c27784

Otherwise the module will call
https://api.linkedin.com/https://api.linkedin.com/v2/me, which is incorrect :slight_smile:

3 Likes

Brilliant great spot

Got a bit further but now I’m getting a permission error on the shares api

Any ideas?

Shares API seems to be depreciated

To share an organisation post to a personal feed you need to use the new /rest/posts POST API

My body was

{
“author”: “urn:li:person:PERSONID”,
“commentary”: “Sample text Post”,
“visibility”: “PUBLIC”,
“distribution”: {
“feedDistribution”: “MAIN_FEED”,
“targetEntities”: ,
“thirdPartyDistributionChannels”:
},
“lifecycleState”: “PUBLISHED”,
“isReshareDisabledByAuthor”: false,
“reshareContext”: {
“parent”: “INSERT POST URN TO BE SHARED”
}
}

You can get the person id from the /me api

The post URN can be retrieved via the watch posts module

Running the posts API with the following info produces the following output

Wonderful

3 Likes

Hey there @Ryan_Farren :wave:,

Just thought I might step in and pat you on the back for the great job you did while figuring out this problem with @samliew’s help. I’m thrilled to see you were able to learn more about the product and come up with a solution! :clap:

Also thank you for stepping back into the community and sharing your solution with us. We greatly appreciate that.
Keep up the amazing work!

2 Likes