LinkedIn API v2 how to use r_basicprofile for fields?

Viewed 10362

It's January 2019. I'm migrating to LinkedIn API v2, as LinkedIn requires. My app has set up && been granted (by user clicks) these permissions shown in this picture. enter image description here The simplest API call is GET "/v2/me" with no extra query string, which returns data in this shape:

"{\"lastName\":{\"localized\":{\"en_US\":\"Jobs\"},\"preferredLocale\":{\"country\":\"US\",\"language\":\"en\"}},\"firstName\":{\"localized\":{\"en_US\":\"Steve\"},\"preferredLocale\":{\"country\":\"US\",\"language\":\"en\"}},\"profilePicture\":{\"displayImage\":\"urn:li:digitalmediaAsset:X9999XXXX5-XXx9-bye\"},\"id\":\"XyyyyXXXXX\"}"

But I wish to ask for more fields (all of which are allowed once I have r_basicprofile as mentioned https://developer.linkedin.com/docs/ref/v2/profile/basic-profile) by GET "/v2/me?fields=id,firstName,lastName,headline,profilePicture", but received:

"{\"serviceErrorCode\":100,\"message\":\"not enough permissions to access field headline for GET /me\",\"status\":403}"

Indeed https://developer.linkedin.com/docs/guide/v2/people/profile-api did NOT say /v2/me can have query string like ?fields=id,firstName,lastName,headline,profilePicture. If this query string is not allowed right now. what am I benefiting from r_basicprofile?

I have also tried GET "/v2/people/(id:{person ID})", which got

"{\"serviceErrorCode\":100,\"message\":\"Not enough permissions to access: GET /people/(id:XyyyyXXXXX)\",\"status\":403}"
2 Answers

From the documentation, in addition to updating your scope to r_liteprofile, you would have to change the API endpoint from people/~:(id,firstName,lastName) to me?projection=(id,firstName,lastName) to get the basic profile details.

Related