如何检索有关LinkedIn帐户的所有可能信息?(使用C#的API)

37

我正在编写一个C#应用程序来利用Linkedin的API

我希望能够查询“人员”(名字+姓氏)并检索关于这些人的所有可能信息具有相同的姓名

目前,我正在使用自己实现的REST API以及People-Search API调用。

这是一个我知道有效的请求示例:

https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,headline,picture-url),num-results)?

我正在使用以下方式运行它:问号后面first-name=参数&last-name=参数

问题是,我想检索更多信息,如标题、行业、当前公司、当前学校等。请参考此处以获取可能参数的列表。

这种表示法被称为字段选择器

我如何构建我的 API 调用,以便可以获取有关某个人的所有可能信息?

3个回答

42

这里是获取用户个人资料的完整URL:

https://api.linkedin.com/v1/people/~:(id,first-name,last-name,headline,picture-url,industry,summary,specialties,positions:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker)),educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes),associations,interests,num-recommenders,date-of-birth,publications:(id,title,publisher:(name),authors:(id,name),date,url,summary),patents:(id,title,summary,number,status:(id,name),office:(name),inventors:(id,name),date,url),languages:(id,language:(name),proficiency:(level,name)),skills:(id,skill:(name)),certifications:(id,name,authority:(name),number,start-date,end-date),courses:(id,name,number),recommendations-received:(id,recommendation-type,recommendation-text,recommender),honors-awards,three-current-positions,three-past-positions,volunteer)?oauth2_access_token=PUT_YOUR_TOKEN_HERE

需要Oauth2访问令牌。

以下是Java中的字符串列表:

apiUrl
    + "/v1/people/~:("
        + "id,"
        + "first-name,"
        + "last-name,"
        + "headline,"
        + "picture-url,"
        + "industry,"
        + "summary,"
        + "specialties,"
        + "positions:("
            + "id,"
            + "title,"
            + "summary,"
            + "start-date,"
            + "end-date,"
            + "is-current,"
            + "company:("
                + "id,"
                + "name,"
                + "type,"
                + "size,"
                + "industry,"
                + "ticker)"
        +"),"
        + "educations:("
            + "id,"
            + "school-name,"
            + "field-of-study,"
            + "start-date,"
            + "end-date,"
            + "degree,"
            + "activities,"
            + "notes),"
        + "associations," /* Full Profile */
        + "interests,"
        + "num-recommenders,"
        + "date-of-birth,"
        + "publications:("
            + "id,"
            + "title,"
            + "publisher:(name),"
            + "authors:(id,name),"
            + "date,"
            + "url,"
            + "summary),"
        + "patents:("
            + "id,"
            + "title,"
            + "summary,"
            + "number,"
            + "status:(id,name),"
            + "office:(name),"
            + "inventors:(id,name),"
            + "date,"
            + "url),"
        + "languages:("
            + "id,"
            + "language:(name),"
            + "proficiency:(level,name)),"
        + "skills:("
            + "id,"
            + "skill:(name)),"
        + "certifications:("
            + "id,"
            + "name,"
            + "authority:(name),"
            + "number,"
            + "start-date,"
            + "end-date),"
        + "courses:("
            + "id,"
            + "name,"
            + "number),"
        + "recommendations-received:("
            + "id,"
            + "recommendation-type,"
            + "recommendation-text,"
            + "recommender),"
        + "honors-awards,"
        + "three-current-positions,"
        + "three-past-positions,"
        + "volunteer"
    + ")" 
    + "?oauth2_access_token="+ token;

1
你会如何编辑URL以便返回JSON格式的数据? - meteorBuzz
你如何获取用户的电子邮件?我尝试使用JSON中的email-address,但它没有返回任何内容。但是当我尝试查询APIUrl + "/v1/people/~:(" + "id," + "first-name," + "last-name," + "email-address"时,我可以得到电子邮件。你有什么建议吗?谢谢 - kdnerd
如何获取位置? - Rohit Tigga
谢谢!在文档中没有示例...这是我处理过的最糟糕的公共API之一。 - HelloWorld
你能告诉我如何获取访问令牌吗?我无法获取它,我正在遵循领英的官方文档。 - Prasanna
显示剩余2条评论

27
你已经掌握了标记,现在需要做的就是添加其余的字段选择器,并在需要嵌套它们的地方进行嵌套。
https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,headline,picture-url,industry,positions:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker)),educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes)),num-results)?first-name=parameter&last-name=parameter

请记住,根据个人资料字段文档,您只能获取当前用户的一度关系的教育信息。



12

我使用这个URL获取所有内容,包括电子邮件,并以JSON格式呈现:

https://api.linkedin.com/v1/people/~:(id,first-name,email-address,last-name,headline,picture-url,industry,summary,specialties,positions:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker)),educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes),associations,interests,num-recommenders,date-of-birth,publications:(id,title,publisher:(name),authors:(id,name),date,url,summary),patents:(id,title,summary,number,status:(id,name),office:(name),inventors:(id,name),date,url),languages:(id,language:(name),proficiency:(level,name)),skills:(id,skill:(name)),certifications:(id,name,authority:(name),number,start-date,end-date),courses:(id,name,number),recommendations-received:(id,recommendation-type,recommendation-text,recommender),honors-awards,three-current-positions,three-past-positions,volunteer)?format=json


这是一个完美的API调用,但由于最近开发者计划的变化,除非您是合作伙伴计划的一部分,否则许多这些字段将无法访问。如果您想测试上述调用,可以使用类似于此控制台的东西 https://apigee.com/console/linkedin - Daisy R.
现在对我来说仍然有效。因为我只想知道自己的数据。Apogee控制台真是太棒了。 - Glenn Plas
message: "Unknown authentication scheme", - Green
@DaisyR。你不会知道是哪个合作伙伴计划吧?那些计划的描述是由一个完全没有技术背景的人编写的,我无论如何都无法弄清楚要符合什么条件。我正在寻找包括工作历史和教育经历在“我的网站”档案中的内容。 - user1600649
@Melvyn 我同意,我的前公司申请过,但被拒绝了,所以我们只能访问基本信息。我会尽力使这个申请更加强大,以便将完整的API访问集成到您的应用程序中,我相信这是链接 https://developer.linkedin.com/partner-programs/apply 祝你好运! - Daisy R.
这个apigee.com/console/linkedin无法工作。 显示 错误410:API控制台服务不再可用。 - HamzaMushtaq

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接