6

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

Ricardo Garza V.
  • 899
  • 1
  • 11
  • 26
  • 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](https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api?context=linkedin/consumer/context#permissions) section – Matteo Mar 19 '19 at 08:25
  • @Matteo I'd post that as the answer - permissions are pretty clearly the issue here. – bsplosion May 06 '19 at 17:37
  • @Ricardo Garza V. my comment doesn't solve? – Matteo May 06 '19 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 – Ricardo Garza V. May 07 '19 at 22:55
  • Same problem for me. Did you solve it? – Oliver Nybroe May 31 '19 at 14:25
  • 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 URL – Ricardo Garza V. Jun 10 '19 at 17:17

1 Answers1

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)
paolooo
  • 4,133
  • 2
  • 18
  • 33