我最近开始阅读和测试 LinkedIn 的 API,但在使用时遇到问题 field selectors
我的目标是使用 API 来获取有关人员的信息,例如名字、姓氏、当前公司和职位。
默认情况下,people-search api 仅返回 id,first-name and last-name
.
我读过,我可以使用一些 field-selectors改进结果,但我的问题是,how do i use the field selectors with the parameters i want them to match aswell.
我试过了 :
http://api.linkedin.com/v1/people-search?first-name=marcello&last-name=lins:(id,first-name,last-name,current-company,title)
但它不起作用,向我抛出一个异常,说它是
Bad request
.我必须提出两个要求吗?
1: https://api.linkedin.com/v1/people-search?first-name=marcello&lastname=lins
2: https://api.linkedin.com/v1/people-search?:(first-name,last-name,current-company,title)
预先感谢您的关注,如果我的帖子不适合任何 XDA 模式,请随时编辑我的帖子。
最佳答案
This API is now only available for the Linkedin Partners
每 documentation ,以下模式用于 People Search API:
http://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,picture-url,headline),num-results)?first-name=Steve&last-name=Smith
所有查询字符串参数都是可选的(完整列表在文档页面上),指定的字段选择器可以在 this page 上找到。 .
您需要将字段选择器指定为“people”的原因是 People Search API 还可以返回“facets”,它可以在您的搜索 UI 中用于提供有关结果的信息。在这种情况下,我们将返回我们可以解析并转换为一组复选框的位置方面,类似于在 LinkedIn.com 搜索页面上找到的那些:
http://api.linkedin.com/v1/people-search:(facets:(code,buckets:(code,name)),people:(id,first-name,last-name,picture-url,headline),num-results)?first-name=Steve&last-name=Smith&facets=location
您可以在 REST Console 上测试所有这些查询。 .
关于api - LinkedIn API 字段选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8576913/