Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LinkedIn V2 API permission's don't seem to be working

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.

like image 345
Gordo Avatar asked Nov 08 '22 12:11

Gordo


1 Answers

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

like image 171
Basil Kosovan Avatar answered Nov 15 '22 05:11

Basil Kosovan