Search code examples
linkedin-api

LinkedIn API request fails with "Unpermitted fields present in RESOURCE_KEY: Data Processing Exception while processing fields [/memberId]"


I'm trying the following request:

GET https://api.linkedin.com/v2/people/(id:urn:li:person:<person id>)?oauth2_access_token=<token>&projection=(results*(localizedFirstName,vanityName))

But I always get a:

{
    "serviceErrorCode": 100,
    "message": "Unpermitted fields present in RESOURCE_KEY: Data Processing Exception while processing fields [/memberId]",
    "status": 403
}

If I try to do it using the alternative API:

GET https://api.linkedin.com/v2/people?ids=List((id:urn:li:person:<person id>))&oauth2_access_token=<token>&projection=(results*(localizedFirstName,vanityName))

An Internal Server Error is returned:

{
    "message": "Internal Server Error",
    "status": 500
}

I'm using Google Chrome to perform those requests.

I tried using Postman too.

Headers:

X-Restli-Protocol-Version: 2.0.0
Authorization: Bearer <token>

Got:

{
    "serviceErrorCode": 0,
    "message": "Syntax exception in path variables",
    "status": 400
}

My app permissions are:

  • r_emailaddress
  • r_ads
  • w_organization_social
  • rw_ads
  • r_basicprofile
  • r_liteprofile
  • r_ads_reporting
  • r_organization_social
  • rw_organization_admin
  • w_member_social

I tried other APIs (socialActivity, ugcPosts) and everything looks fine.

I checked my API usages at https://www.linkedin.com/developers/apps/<id>/usage and people usage is currently 0%.

The tested user profiles are also public.


Solution

  • You should only use the id (instead of the urn). also the fields projection is wrong:

    Use:

    projection=(localizedFirstName,vanityName)
    

    Instead of:

    projection=(results*(localizedFirstName,vanityName))
    

    As example:

    curl -H "X-Restli-Protocol-Version: 2.0.0" \
    "https://api.linkedin.com/v2/me?oauth2_access_token=<TOKEN>&projection=(id)"
    

    Will return

    {
      "id": <ID>
    }
    

    and use it as:

    curl -H "X-Restli-Protocol-Version: 2.0.0" \
    "https://api.linkedin.com/v2/people/(id:<ID>)?oauth2_access_token=<TOKEN>&projection=(localizedFirstName,vanityName)"
    

    So:

    {
      "vanityName": "<VANITY-NAME>",
      "localizedFirstName": "<NAME>"
    }
    

    Hope this help