LinkedIn V2 API Resolution doesn't seem to work

I am developing an application that integrates some related functions, and we are testing API version 2.

But when we try to request something from the API, we get an error that says the following:

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

The challenge we make is: https://api.linkedin.com/v2/me

I am attaching our OAuth2 code like this, after getting it from the corresponding URL:

request.AddHeader("authorization", "Bearer " + authCode);

Here is the complete request we make for the associated 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;

When connecting, we use OAuth2 to authenticate our user token and request all permissions with:

&scope=r_basicprofile%20r_emailaddress%20rw_company_admin%20w_share

Link to related documentation: https://developer.linkedin.com/docs/guide/v2

In addition, I tested the OAuth2 token with the API version 1, and it works great for everything we throw at it.

, ​​, , , .

: - , , - V2 API, .

+4

Source: https://habr.com/ru/post/1692208/


All Articles