简体   繁体   English

Linkedin API获得公众关注

[英]Linkedin API get public-profile

I am trying to get the id from the public-profile-url . 我正在尝试从public-profile-url获取id The query looks like: 查询看起来像:

https://api.linkedin.com/v1/people/url={https://www.linkedin.com/in/name}

However, what I get get back from linkedin is: 但是,我从linkedin中得到的是:

<error>
 <status>400</status>
 <timestamp>1460131755319</timestamp>
 <request-id>2OV9FJ0DTR</request-id>
 <error-code>0</error-code>
 <message>[invalid.param.url]. Public profile URL is not correct,
 {url=}; should be {https://www.linkedin.com/pub/[member-name/]x/y/z} or
 {https://www.linkedin.com/in/string}</message>

The interesting part is: 有趣的部分是:

Public profile URL is not correct, {url=}; should be {https://www.linkedin.com/pub/[member-name/]x/y/z} or {https://www.linkedin.com/in/string}

The url clearly adheres to the rules that they mention and the url works. url显然遵守其提及的规则,并且该网址有效。 Any idea on how to fix it? 关于如何解决它的任何想法?

You cannot reliably retrieve a member ID from a profile URL. 您无法从个人资料URL可靠地检索成员ID。 id values that you can rely on are returned as part of Profile API calls. 您可以依赖的id值将作为Profile API调用的一部分返回。 From time to time, LinkedIn changes the format of it's public profile URLs, so attempting to parse them or reconstruct them can leave your app in a broken state. LinkedIn会不时更改其公共资料URL的格式,因此尝试解析或重建它们可能会使您的应用程序处于损坏状态。 The public-profile-url field should be considered read-only, and not something you try and parse or create yourself. public-profile-url字段应被视为只读字段,而不是您尝试解析或创建的内容。

eg: GET https://api.linkedin.com/v1/people/~:(id,first-name,last-name,public-profile-url)?format=json 例如: GET https://api.linkedin.com/v1/people/~:(id,first-name,last-name,public-profile-url)?format=json

id values are encoded to specific LinkedIn applications and cannot be re-used between apps. id值编码到特定的LinkedIn应用程序,并且不能在应用程序之间重复使用。 As a result, any value you attempt to pull out of a URL won't be of any use to you. 结果,您尝试从URL中提取的任何值对您都没有任何用处。 The information needs to be acquired via an API call. 该信息需要通过API调用获取。

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

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