2

I set up an app on linkedIn. Set up and tested code to return an access token. Which all worked fine. I tried to get basic profile data and it says I do not have proper access rights. I gave the app all basic permission other than write posts so I am at a loss for why nothing is being returned.

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

My code is below.THETOKENWOULDBEHERE in the live code is the token returned by the oauth process. If anyone has any insights it would be appreciated.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.linkedin.com/v2/me");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-RestLi-Protocol-Version:2.0.0','x-li-format: json','Authorization: Bearer *THETOKENWOULDBEHERE*'));
$response = curl_exec($ch);
curl_close($ch);
print_r($response);
kengTW
  • 23
  • 3
  • Explain the oauth request better. Using `r_liteprofile` and/or `r_emailaddress ` scopes? – ficuscr Jan 03 '19 at 18:46
  • @ficuscr I requested `r_basicprofile` `r_emailaddress` and `rw_company_admin` with the basic account it seems you only have access to 4 and I requested the 3 that looked to make sense. Do I need to request access to those others? – kengTW Jan 03 '19 at 19:34
  • I've not RTFM but... https://stackoverflow.com/questions/50363237/not-enough-permissions-to-access-me-get/50367551 suggests `r_basicprofile` is'nt an option. – ficuscr Jan 03 '19 at 19:45
  • I'll take a look at `r_liteprofile`. basic is an option and I didn't see lite as an option but I'll give it a shot. – kengTW Jan 03 '19 at 21:51

1 Answers1

0

If you are using V2 and you did not taken permission to use r_basicprofile then either apply for permission to use r_basicprofile to linkedin or use r_liteprofile + r_emailaddress

Check this : https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context

KPSingh
  • 489
  • 1
  • 3
  • 7
  • Thanks for some reason the docs on microsoft seem more detailed than on linkedin. This is very helpful. – kengTW Jan 04 '19 at 18:24