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

6
  • 2
    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 section
    – Matteo
    Mar 19, 2019 at 8:25
  • @Matteo I'd post that as the answer - permissions are pretty clearly the issue here.
    – bsplosion
    May 6, 2019 at 17:37
  • @Ricardo Garza V. my comment doesn't solve?
    – Matteo
    May 6, 2019 at 19:01
  • 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 projection May 7, 2019 at 22:55
  • Same problem for me. Did you solve it? May 31, 2019 at 14:25

1 Answer 1

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.