linkedin cat get vanity name
Asked Answered
L

1

7

Hi I am trying to get the profile url for the user that is logging in from linkedin(the login part has been nailed), but according to the documentation I need to request for the vanity name from the api.

So I requested it like follows:

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

to no avail, note that there was no access denied or error, and it returns some of the data, but no vanityName. Example returnes json with deleted parts

{
"firstName": ...
},
"lastName": ...
},
"profilePicture":...,
"id":"M-jljLc2ue"
}

I am using the following docs as a reference

https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api?context=linkedin/consumer/context.

If of any use, I am using the laravel socialite packages as a base

Lock answered 18/3, 2019 at 22:44 Comment(6)
With your API I can retrieve the vanityName field. Double check your app have the valid permission (r_basicprofile as described in the doc you linked in the permission sectionExcellency
@Excellency I'd post that as the answer - permissions are pretty clearly the issue here.Loco
@Ricardo Garza V. my comment doesn't solve?Excellency
have tried playig with the permissions, and I see how the permisions change in the linkedin GUI when accepting for r_basicprofile but that was not the problem @Matteo, I do get different that from the ajax when i remove the projectionLock
Same problem for me. Did you solve it?Grog
could not solve it, because the only info I needed from the login was the vanity name, I endedn up putting a textbox so the user pastes his linkedin URLLock
I
3

You can't get the vanityName or public profile URL in v2, unless, you have the permit approved by LinkedIn. They also discourage if you apply for the partner program to get the vanityName.

Please check the links & quotes below.

https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api?context=linkedin/consumer/context

The use of this API is restricted to those developers approved by LinkedIn and subject to applicable data restrictions in their agreements.

https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api-v1-migration

Please do not apply to a partner program like the Marketing Developer Platform if you are seeking access to member profile data that is not made available via the new “Lite Profile” permission. Access to partner programs is appropriate for select use cases only, and all other requests for access will be rejected.

https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context

List of LinkedIn v1 API permissions (old)

  • r_basicprofile
  • r_emailaddress
  • w_share
  • rw_company_admin

List of LinkedIn v2 API permissions (new)

  • r_liteprofile (replaces r_basicprofile)
  • r_emailaddress
  • w_member_social (replaces w_share)
Ingra answered 14/7, 2019 at 4:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.