Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LinkedIn API v2 how to use r_basicprofile for fields?

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}"
like image 892
Morris Avatar asked Jan 10 '19 19:01

Morris


1 Answers

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~))

like image 126
KPSingh Avatar answered Sep 30 '22 12:09

KPSingh