I'm developing an app which integrates some linked-in functionality, and we are testing out the version 2 API.
But when we try and request anything from the API we retrieve an error which states the following:
{"serviceErrorCode":100,"message":"Not enough permissions to access /me GET ","status":403}
The call we are making is this: https://api.linkedin.com/v2/me
I'm attaching our OAuth2 code like this, after retrieving it from the appropriate URL:
request.AddHeader("authorization", "Bearer " + authCode);
Here is the complete request we make to the linkedin API:
// start rest client
var client = new RestClient("https://api.linkedin.com/v2/");
// retrieve our linkedin profile
var request = new RestRequest("me", Method.GET);
// attach our auth code
request.AddHeader("authorization", "Bearer " + authCode);
// execute query
var response = client.Execute(request);
// display the result on the screen
ViewBag.Message = "output: " + response.Content;
On linked-in we're using OAuth2 to authenticate our user token, and requesting all the permissions using:
&scope=r_basicprofile%20r_emailaddress%20rw_company_admin%20w_share
Relevant documentation link: https://developer.linkedin.com/docs/guide/v2
Additionally, I've tested our OAuth2 token with the version 1 API, and it functions perfectly fine for everything we throw at it.
I've done lots of digging into this, and there is some mention of three legged authorisation but no supporting linked-in article which I can find, which describes this process.
My question is, does anyone know how to make this work properly, has anyone had success with the V2 API, and can you help me solve my issue with the request.
You need to change permissions. Some of them has deprecated(r_basicprofile). I recommend use Migration FAQ. Please see next link https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With