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

时间:2011-12-21 16:35:12

标签: api linkedin

我正在编写一个C#应用程序以使用Linkedin's API

我希望能够查询“人”(名字+姓氏)并检索有关此人群的所有可能信息with the same name

我目前正在使用我自己的REST APIPeople-Search API调用的实现。

以下是我知道有效的请求示例:

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

我正在运行:first-name=parameter&last-name=parameter after the ? mark

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

这种表示法是他们所谓的Field Selectors

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

3 个答案:

答案 0 :(得分:39)

以下是获取用户个人资料的所有内容的网址:

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 :(得分:23)

你已经记下了符号,你需要做的就是添加其余的字段选择器,在需要的地方嵌套它们:

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

请注意,根据Profile Field docs,您只能接受当前用户的第一级连接的培训。

答案 2 :(得分:11)