简体   繁体   English

Linkedin Profile API与公开可用的URI

[英]Linkedin Profile API vs Publicly Available URIs

I have a database of people's names and LinkedIn profile URLs. 我有一个人名和LinkedIn个人资料网址数据库。 Annoyingly there isn't a standard format for LinkedIn URLs (like twitter) but there are generally in the form of: 令人恼火的是,LinkedIn URL(如twitter)没有标准格式,但通常采用以下形式:

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

On my site I want to display people's LinkedIn details. 在我的网站上,我想显示人们的LinkedIn详细信息。 I've got OAuth working fine and for people with the first format (above) I can successfully display their LinkedIn data on my site. 我已经让OAuth工作正常,对于第一种格式的人(上图),我可以在我的网站上成功显示他们的LinkedIn数据。 I'm using the "Public Profile URL" option from https://developer.linkedin.com/documents/profile-api 我正在使用https://developer.linkedin.com/documents/profile-api中的“公开个人资料网址”选项

But for the second format I'm having problems. 但对于第二种格式,我遇到了问题。 It's invalid as a "public profile" and the ID in the URL doesn't seem to be the "member_id" from the link above. 它作为“公共配置文件”无效,并且URL中的ID似乎不是上面链接中的“member_id”。

Btw, if I try to use this numeric ID as a member_id I get the following error: 顺便说一句,如果我尝试将此数字ID用作member_id,我会收到以下错误:

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

From poking around with the API the only way I can get the alphanumeric id (member_id) is from a successful API call (blah->person->id). 从使用API​​开始,我可以获得字母数字id(member_id)的唯一方法是成功的API调用(blah-> person-> id)。 But to make a successful API call I first need a valid URI. 但是为了成功进行API调用,我首先需要一个有效的URI。 So it seems to be a chicken and egg situation. 所以它似乎是鸡和鸡蛋的情况。

Any suggestions as to how I can display LinkedIn data by using the second URL above? 有关如何使用上面的第二个URL显示LinkedIn数据的任何建议?

Looks like there are two issues here at play: 看起来这里有两个问题:

1) The technical issues. 1)技术问题。 You are correct that you cannot retrieve a user's profile via the Profile API via the second URL, you can only do it via the unique public-profile-url , via the member ID, or via the ~ to retrieve the current user's profile. 你是无法通过Profile API通过第二个URL检索用户的个人资料 ,你只能通过唯一的public-profile-url ,通过会员ID,或通过~来检索当前用户的个人资料。

Member ID is not related to the number you see in the query string - the member ID is a alphanumeric token generated uniquely for each user for each API application, so user A via your application will have a different member ID than the same user A via my application. 成员ID与您在查询字符串中看到的数字无关 - 成员ID是为每个API应用程序的每个用户唯一生成的字母数字标记,因此用户A通过您的应用程序将具有与同一用户A不同的成员ID我的应用程序。

Are you just retrieving the member profiles arbitrarily or are you trying to retrieve profile information from connections of the viewing authenticated user? 您只是随意检索成员配置文件,还是尝试从查看身份验证用户的连接中检索配置文件信息? You should be able to either pull the viewer's connections public-profile-url , or pull it via a People Search , etc. 您应该能够拉取查看者的连接public-profile-url ,或通过人物搜索等拉动它。

2) The platform guidelines . 2) 平台指南 Basically, you can only show profile information about a particular LinkedIn user to viewers by pulling the information on behalf of that user. 基本上,您只能通过代表该用户提取信息,向观看者显示有关特定LinkedIn用户的个人资料信息。 Meaning, that the viewer has authenticated against the API; 这意味着,观众已经对API进行了身份验证; you don't mention whether this will be the case, but adhering to #2 will potentially help solve #1. 你没有提到是否会出现这种情况,但坚持#2可能有助于解决#1问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM