Linkedin API vs. Public URIs

I have a database of usernames and LinkedIn profile URLs. Annoyingly, there is no standard LinkedIn URL format (such as Twitter), but they usually take the form:

1) http://www.linkedin.com/in/geoffroyondet
2) http://www.linkedin.com/profile/view?id=34178115

On my site I want to display information about LinkedIn. My OAuth works fine, and for people with the first format (above), I can successfully display LinkedIn data on my site. I am using the "Shared Profile URL" parameter from https://developer.linkedin.com/documents/profile-api

But for the second format I have problems. It is not valid as a "public profile", and the identifier in the URL does not seem to be the "member_id" from the above link.

Btw, if I try to use this numeric identifier as member_id, I get the following error:

object(SimpleXMLElement)[652] public 'status' => string '404' (length=3) ... public 'message' => string 'Invalid member id {34178115}' (length=28) 

Due to the fact that I'm trying to use the API, the only way to get the alphanumeric identifier (member_id) is to successfully call the API (blah-> person-> id). But for a successful API call, I first need a valid URI. So it looks like the situation with the chicken and the egg.

Any suggestions on how I can display LinkedIn data using the second URL above?

+4
source share
1 answer

There seem to be two problems here:

1) Technical problems. You are right that you cannot get the user profile through the Profile API via the second URL, you can only do this using the unique public-profile-url , through the identifier of the element or through ~ to get the current user profile.

The member ID is not associated with the number that you see in the query string. A member ID is an alphanumeric token that is uniquely generated for each user for each API application, so user A through your application will have a different member identifier, user A through my application.

Are you just randomly retrieving member profiles or trying to get profile information from authenticated user connections? You must be able to either pull viewer connections public-profile-url , or pull it through People Search , etc.

2) platform rules . Basically, you can only show profile information about a specific LinkedIn user to viewers by pulling out information on behalf of that user. This means that the viewer is authenticated against the API; you didn't mention if that would be the case, but sticking to # 2 would potentially help solve # 1.

+6
source

Source: https://habr.com/ru/post/1380560/


All Articles