LinkedIn API字段选择器 [英] LinkedIn API Field Selectors

查看:71
本文介绍了LinkedIn API字段选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始阅读和测试LinkedIn的API,使用field selectors

I started reading and testing LinkedIn's API recently and i am having problems when using field selectors

我的目标是使用API​​来获取有关人员的信息,例如其名字,姓氏,当前公司和头衔.

My goal is to use the API to fetch information about people, like its first-name,last-name,current-company and title for example.

默认情况下, people-search api仅返回id,first-name and last-name.

By default,the people-search api returns only id,first-name and last-name.

我已经读过,我可以使用一些字段选择器来优化结果,但我的问题是how do i use the field selectors with the parameters i want them to match aswell.

I've read that,i can use some field-selectors to refine the result, but my question is, 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.

But it does not work,throws me an exception saying that it is a Bad request.

我必须提出两个请求吗?

Do i have to make two requests ?

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模式,请提前感谢您的关注,并随时编辑我的线程.

Thanks in advance for the attention and feel free to edit my thread if it is not fitting any XDA-Pattern.

推荐答案

此API现在仅适用于Linkedin合作伙伴

This API is now only available for the Linkedin Partners

根据文档,People Search API使用以下模式:

Per the documentation, the following pattern is used on the 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

所有querystring参数都是可选的(完整列表在docs页上),并且指定的字段选择器可以在

All of the querystring parameters are optional (a full list is on the docs page), and the specified field selectors can be found on this page.

您需要指定字段选择器为人物"的原因是,人物搜索API还可以返回构面",可在您的搜索UI中使用该构面来提供有关结果的信息.在这种情况下,我们将返回可以解析并变成一组复选框的位置构面,类似于在LinkedIn.com搜索页面上找到的那些构图:

The reason that you need to specify that the field selectors are 'people' is that the People Search API can also return 'facets' which can be used in your search UI to give information about the results. In this case, we'll return the location facets which we could parse and turn into a set of checkboxes, similar to those found on the LinkedIn.com search page:

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控制台上测试所有这些查询.

You can test all of these queries on the REST Console.

这篇关于LinkedIn API字段选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆