我最近开始阅读和测试LinkedIn的API,我在使用时遇到了问题 field selectors
我的目标是使用API来获取有关人员的信息,例如其名字,姓氏,当前公司和标题.
默认情况下,people-search api仅返回id,first-name and last-name.
我已经读过了,我可以使用一些字段选择器来改进结果,但我的问题是,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)
Run Code Online (Sandbox Code Playgroud)
但它不起作用,抛出一个例外,说它是一个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)
Run Code Online (Sandbox Code Playgroud)
如果它不适合任何XDA模式,请提前感谢您的注意,并随时编辑我的主题.
此API现在仅适用于Linkedin合作伙伴
根据文档,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
Run Code Online (Sandbox Code Playgroud)
所有查询字符串参数都是可选的(完整列表位于文档页面上),并且可以在此页面上找到指定的字段选择器.
您需要指定字段选择器为"人员"的原因是People Search API还可以返回"facets",可以在搜索UI中使用这些"facets"来提供有关结果的信息.在这种情况下,我们将返回我们可以解析的位置构面并转换为一组复选框,类似于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
Run Code Online (Sandbox Code Playgroud)
您可以在REST控制台上测试所有这些查询.
| 归档时间: |
|
| 查看次数: |
4724 次 |
| 最近记录: |