Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linkedin-api

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?

like image 921
Avishekh Bharati Avatar asked Sep 11 '17 06:09

Avishekh Bharati


2 Answers

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

like image 78
Sinister Beard Avatar answered Sep 27 '22 17:09

Sinister Beard


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

like image 36
DiClem Avatar answered Sep 27 '22 18:09

DiClem