LinkedIn API v2 how to use r_basicprofile for fields?
Asked Answered
M

2

6

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}"
Molly answered 10/1, 2019 at 19:21 Comment(1)
This is tricky but I think learn.microsoft.com/en-us/linkedin/consumer/integrations/… states that r_basicprofile should no longer be used in API v2. The r_liteprofile is replacing it; r_liteprofile gives way fewer fields.Molly
U
9

Before 1st March You have to Move in V2 r_basicprofile is there because you can use this with V1 till 1st march after that this will automatically deleted

in V2 you have to use :

r_liteprofile for firstName,lastName,profilePicture,id - https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams))

r_emailaddress for getting emailAddress - https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))

Ume answered 12/1, 2019 at 23:25 Comment(6)
Where do you see in the documentation that r_basicprofile can't be used in V2 of API? I'm not saying you're wrong, I just can't find that mentioned in docs anywhere.Wabble
Never mind I see it now! If you have access to partner program you can still use r_basicprofile but otherwise you're correct you need to use r_liteprofileWabble
Yes, You are correct at many place i already written for using r_basicprofile you have to take permission from linkedin. I mean need to access partnership program.Ume
So today it is 6th March 2019 and we still have the r_basicprofile permission. So if we cant use v1 anymore, why is r_basicprofile permission still there? Where does your information, that the permission should have been automatically deleted, come from?Trisomic
Here they've documented that one needs to "have applied and been approved for a LinkedIn Partner Program": learn.microsoft.com/en-us/linkedin/shared/references/v2/…Nilotic
what about the headline?Quebec
L
0

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.

Luker answered 27/2, 2019 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.