25

I have been trying to use the linkedin V2 api, but constantly getting error. I created an developer application. Set up redirect url as "https://www.getpostman.com/oauth2/callback" to make request using postman (as per postman documentation). Filled up form to request access token.

enter image description here

But everytime I use the token and make a query, I get an error:

enter image description here

But I have selected all the default application permissions in my application. Am I missing something?

Avishekh Bharati
  • 1,858
  • 4
  • 27
  • 44

4 Answers4

8

The LinkedIn API has been largely closed off and is only available to approved LinkedIn developers. You can request authorisation here: https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program

Sinister Beard
  • 3,570
  • 12
  • 59
  • 95
  • I just want to implement sign up. Do I still have to apply there. – Amarjit Singh Dec 14 '18 at 18:15
  • 1
    `r_basicprofile` should theoretically be accessible without requesting this formal authorization. https://learn.microsoft.com/en-us/linkedin/shared/references/v2/profile/basic-profile?context=linkedin/consumer/context However, many fields are not working for me even after getting`r_basicprofile` granted by the user. – Morris Dec 18 '18 at 19:04
  • @Sinister Beard, there isn't any reason to request this authorisation if we only need do use OAuth2 basic profile - in my case, only email address. There isn't anything in LinkedIn user guide for developers that suggest to do this. – mold Mar 27 '19 at 14:59
  • 1
    @mpoletto No, there isn't - but that's the documentation being lacking. – Sinister Beard Mar 27 '19 at 15:25
  • @SinisterBeard How can you sure about that? – mold Mar 27 '19 at 15:27
  • I mean, I can't prove a negative, but can you make it work? – Sinister Beard Mar 27 '19 at 16:00
  • @SinisterBeard No, I can't. And I tried to request an authorisation to become a marketing partner and they denied. Now, I understand there isn't any information in official documentation about the new politic to approve new developers users for their API. – mold May 31 '19 at 20:04
  • 1
    @mpoletto https://developer.linkedin.com/blog/posts/2015/developer-program-changes - I'll add this to my answer as well. – Sinister Beard Jun 03 '19 at 13:16
  • Does anybody know what permission is needed to access https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/contacts-api ? – Yar Mar 19 '22 at 13:27
4

This is a old question, but the solution is to use the scope r_liteProfile instead of r_basicprofile during the first step of authorization.

https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=*****&redirect_uri=http://yourauthorizationserver&state=RandomString&scope=r_liteprofile

Then, use the value of the code parameter passed back from LinkedIn to http://yourauthorizationserver in the second step of authorization:

curl -X POST \
'https://www.linkedin.com/oauth/v2/accessToken?code=codeobtainedwiththefirstcall&grant_type=authorization_code&client_secret=*****&client_id=***&redirect_uri=yourredirecturi' \

Solution found here: Any queries to the api.linkedin.com/v2/ return "Not enough permissions to access ..."

DiClem
  • 336
  • 2
  • 8
-1

have you checked and allowed access to "r_basicprofile" permissions? go to your app and check your Default Application Permissions for people/~/me endpoint.

-2

If you are using https://oauth.io/ you have to add scopes in the Keys and Permission Scope configuration page:

enter image description here

Achraf JEDAY
  • 1,936
  • 5
  • 24
  • 33