Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linkedin

  1. I got the Access Token (with scope: r_basicprofile rw_company_admin w_share) using the Client ID, Client Secret at following URLs:
    • https://www.linkedin.com/oauth/v2/authorization
    • https://www.linkedin.com/oauth/v2/accessToken
  2. Make request to the https://api.linkedin.com/v2/me endpoint

    curl -H "Authorization: Bearer ACCESS_TOKEN"     -H "Accept: application/json"     -H "Content-Type: application/json"     -H "X-Restli-Protocol-Version: 2.0.0" https://api.linkedin.com/v2/me 
  3. Get response:

    {     "serviceErrorCode": 100,     "message": "Not enough permissions to access /me GET ",     "status": 403 } 

Similar erroneous responses are returned to any requests for https://api.linkedin.com/v2/

In official documentation there is difference requirements to headers:

  • X-Rest**l**i-Protocol-Version
  • X-Rest**L**i-Protocol-Version

But I tried both, and nothing worked.

Requests to the https://api.linkedin.com/v1/ (using the same token) successfully return data.

Please, tell me what I'm doing wrong.

like image 585
Pavel Timofeev Avatar asked Oct 26 '17 17:10

Pavel Timofeev


2 Answers

You need to request permissions from LinkedIn.

Now all requests to api.linkedin.com/v2/ successfully pass to me!

We received permissions (r_ad_campaigns and rw_organization) after request offer by address https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program

Leave a request at the address below and LinkedIn will answer you.

Good luck!

like image 59
Pavel Timofeev Avatar answered Sep 21 '22 18:09

Pavel Timofeev


Use r_liteprofile instead of r_basicprofile during the first step of Authorization. This will solve your issue.

like image 27
Joseph Ranjith Avatar answered Sep 17 '22 18:09

Joseph Ranjith