Leonid Zadorozhnykh
Leonid Zadorozhnykh

Reputation: 333

LinkedIn API and permission for integration

I'm trying to work with LinkedIn API, but it doesn't work.

Basically, what I'm trying to achieve is get other people's basic info using https://api.linkedin.com/v2/people/ endpoint.

https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api?context=linkedin%2Fconsumer%2Fcontext#retrieve-current-members-profile

However, seems like something was changed with permissions and not reflected in the official docs.

Official documentation seems to be outdated, since there is no more scopes like: r_liteprofile OR r_basicprofile

I have a developer app with Share on LinkedIn and Sign In with LinkedIn using OpenID Connect Products added. I was able to get a valid 3-legged token with the scope: profile email w_member_social openid

doc to get it: https://learn.microsoft.com/en-gb/linkedin/shared/authentication/authorization-code-flow?context=linkedin%2Fcontext&tabs=HTTPS1

The only endpoint actually working for me is: /v2/userinfo which returns my name and email but not the ID needed for v2/post for example

However, I can't access none of the end points from the list:

Even the basic me says I don't have permissions.

https://api.linkedin.com/v2/me

OR

https://api.linkedin.com/rest/me with headers: 'LinkedIn-Version': '202401' 'X-Restli-Protocol-Version':'2.0.0'

As well as I tried to access different variations for:

https://api.linkedin.com/v2/people/ https://api.linkedin.com/v2/ugcPosts https://api.linkedin.com/v2/companies/

LinkedId support seems to reply only to developer partners, but how to become one if there is nothing I can do except getting 3-legged token :)))

response is always "status":403,"serviceErrorCode":100,"code":"ACCESS_DENIED","message":"Not enough permissions to access GET/me

Is it possible to any calls to LinkedIn API without being an official Partner or everything is restricted now?

NOTE In case you want to downvote Official docs seems to be outdated, I was checking Official docs and guides, watch YouTube videos, fork GitHub project 1+ years old which used to work.

Upvotes: 0

Views: 358

Answers (1)

Maxime_hrt
Maxime_hrt

Reputation: 11

I have the same products as you in my developer app with the addition of the Advertising API, providing the basic_profile scope (it is also included in the Community Management API).

To get the personal information, I use the https://api.linkedin.com/v2/me endpoint (here is the documentation), and this is a sample response that I get:

{
   "localizedLastName": "<NAME>",
   "profilePicture":{
      "displayImage":"<PROFILE PICTURE URN>"
   },
   "firstName":{
      "localized":{
         "fr_FR":"<FIRST_NAME_FR>",
         "en_US":"<FIRST_NAME_US>",
         "in_ID":"<FIRST_NAME_ID>"
      },
      "preferredLocale":{
         "country":"US",
         "language":"en"
      }
   },
   "vanityName":"<FIRSTNAME-LASTNAME>",
   "lastName":{
      "localized":{
         "fr_FR":"<LAST_NAME_FR>",
         "en_US":"<LAST_NAME_US>",
         "in_ID":"<LAST_NAME_ID>"
      },
      "preferredLocale":{
         "country":"US",
         "language":"en"
      }
   },
   "localizedHeadline":"<PROFILE_HEADLINE>",
   "id":"<ACCOUNT_ID>",
   "headline":{
      "localized":{
         "fr_FR":"<HEADLINE_FR>",
         "en_US":"<HEADLINE_US>",
         "in_ID":"<HEADLINE_ID>"
      },
      "preferredLocale":{
         "country":"US",
         "language":"en"
      }
   },
   "localizedFirstName":"<FIRST_NAME>"
}

Upvotes: 0

Related Questions