2
votes

I want to fetch the Linkedin connections of a user via Auth 2 API. But As per different blogs and information on the internet, I found that I need to get partnered with Linkedin to get the details of Profile.

I need following data for a username, photo, headline, contact information, experience, education, summary, location and connections.

When I try to fetch the data from following APIs

https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,maidenName,phoneticFirstName,phoneticLastName,headline,location,industryName,summary,specialties,positions,profilePicture(displayImage~:playableStreams),vanityName,lastModified,organizations)

Result

API error (403) Not enough permissions to access:

Please help me with the process to fetch the data from Linked API.

Regards

1

1 Answers

0
votes

LinkedIn API v2 by default will request the r_liteprofile when performing the authorize URL. this means that the user will only have to allow you to get a limited subset of information with the granted token.

You need to make sure than upon the authorization request ("https://www.linkedin.com/oauth/v2/authorization") you pass a scope parameter that contains the r_basicprofile in order to get the extra data

see https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq

also https://developer.linkedin.com/docs/ref/v2/profile/basic-profile for the supported fields