How do I get access to this LinkedIn API connections 2024

sami 0 Reputation points
2024-04-05T07:16:02.4966667+00:00

Hello,

I want to get the number of connections of a Linkedin user when they sign in via Oauth2.

In my Linkedin developer, I have an app that the "Sign In with LinkedIn using OpenID Connect" and "Advertising API" permission has been given after request to my company account. So basically in the auth section of the linkedin APP I have the following permissions:
User's image

I use Node JS with passport JS for linkedn. In the Scope of the linkedin I use :

      scope: [
        "r_1st_connections_size",
        "openid",
        "profile",
        "email",
      ],

As far as I understood, I must have "openid" with "profile" and/or "email" in order to get the access token. ( There is also "r_basicprofile" scope but it does not give accessToken and that is why I use openid to get the accessToken.
I also added "r_1st_connections_size" in order the generated token has valid access to the connection number of the user when I call the appropriate endpoint.

Sol basically I call:
GET https://api.linkedin.com/v2/connections?q=viewer&projection=(paging) with the generated accessToken and LinkedIn-Version: 202401 as the input header.
I get :
{ "serviceErrorCode"``: ``100``,`` "message"``: ``"Not enough permissions to access: GET-viewer /connections"``,`` "status"``: ``403 }

I do not understand why I get permission denied when I am getting accessToken belongs to profile and connections API. Did I miss something here?

Thanks

Microsoft Advertising API
Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
386 questions
0 comments No comments
{count} votes