LinkedIn V2 api: Not enough permissions to access /me GET
Asked Answered
L

5

26

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?

Lara answered 11/9, 2017 at 6:31 Comment(0)
D
9

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

Dose answered 20/6, 2018 at 8:31 Comment(9)
I just want to implement sign up. Do I still have to apply there.Mcneil
r_basicprofile should theoretically be accessible without requesting this formal authorization. learn.microsoft.com/en-us/linkedin/shared/references/v2/profile/… However, many fields are not working for me even after gettingr_basicprofile granted by the user.Dareen
@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.Perdure
@mpoletto No, there isn't - but that's the documentation being lacking.Dose
@SinisterBeard How can you sure about that?Perdure
I mean, I can't prove a negative, but can you make it work?Dose
@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.Perdure
@mpoletto developer.linkedin.com/blog/posts/2015/… - I'll add this to my answer as well.Dose
Does anybody know what permission is needed to access learn.microsoft.com/en-us/linkedin/shared/integrations/people/… ?Massacre
R
5

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 ..."

React answered 12/4, 2019 at 10:5 Comment(2)
Thank you so much!Niall
What permission is needed to access learn.microsoft.com/en-us/linkedin/shared/integrations/people/… ?Massacre
J
0

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

Jerrold answered 18/1, 2018 at 16:53 Comment(1)
Even with that permission, it does not appear to work. LinkedIn is completely closed now. We should all stop using it.Sucking
A
0

Correct url for the user info call is: https://api.linkedin.com/v2/userinfo Linkedin doc is not updated as well but this one will for sure work for you enter image description here

Airless answered 9/1 at 17:5 Comment(2)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewSnakebird
Understandable i am kinda new here , So the reason why this url works for the endpoint is because the new linkedin docs have permissions changed from the original ones that were being used like r_basicprofile The new permissions look like this "profile" And hence the api endpoint has also changed i was able to find this endpoint from the internet and this seems to be workingAirless
B
-1

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

enter image description here

Bedridden answered 9/9, 2019 at 14:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.