【问题标题】:Linkedin API - get full dataLinkedin API - 获取完整数据
【发布时间】:2015-09-24 14:19:38
【问题描述】:

我尝试编写一个脚本来从 LINKEDIN 获取数据,我能够获取有关个人资料的许多信息,例如姓名、邮件、电话、图片 url 等等,不幸的是,我怎么尝试都无法获取信息喜欢工作经验等等。

我的请求如下所示:

   $xml_response = $linkedin->getProfile("~:(id,first-name,last-name,interests,publications,patents,languages,skills,date-of-birth,email-address,phone-numbers,im-accounts,main-address,twitter-accounts,headline,picture-url,public-profile-url)");

这可以正常工作,但让我们尝试添加公司

错误:

我在$linkedin->getProfile 的末尾添加了它,这是 我得到的错误信息:

[message] => 资源 {Person} 中的未知字段 {companies}

完整功能如下:

public function linkedinGetUserInfo( $requestToken='', $oauthVerifier='', $accessToken=''){
    include_once 'linkedinoAuth.php';

    $linkedin = new LinkedIn($this->config['linkedin_access'], $this->config['linkedin_secret']);
    $linkedin->request_token    =   unserialize($requestToken); //as data is passed here serialized form
    $linkedin->oauth_verifier   =   $oauthVerifier;
    $linkedin->access_token     =   unserialize($accessToken);

    try{
        $xml_response = $linkedin->getProfile("~:(id,first-name,last-name,interests,publications,patents,languages,skills,date-of-birth,email-address,phone-numbers,im-accounts,main-address,twitter-accounts,headline,picture-url,public-profile-url,educations,companies)");
    }
    catch (Exception $o){
        print_r($o);
    }
    return $xml_response;
}

我找到的文档(但没有帮助我)
https://developer.linkedin.com/docs/fields

我想我会错过一些非常愚蠢但无法弄清楚的事情,有人可以帮助我吗?

【问题讨论】:

    标签: php api oauth linkedin


    【解决方案1】:

    LinkedIn 在 2015 年 5 月 12 日之前提供了所有这些字段。

    https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url,industry,associations,interests,num-recommenders,date-of-birth,honors-awards,three-current-positions,three-past-positions,volunteer,location,"+

    "职位:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker))," +

    “教育:(id,学校名称,学习领域,开始日期,结束日期,学位,活动,笔记),” +

    "出版物:(id,title,publisher:(name),authors:(id,name),date,url,summary),"+

    "语言:(id,语言:(姓名),熟练程度:(等级,姓名)),"+

    "技能:(id,skill:(name)))";

    "课程:(id,name,number),"+

    "recommendations-received:(id,recommendation-type,recommendation-text,recommender))";

    "专利:(id,title,summary,number,status:(id,name),office:(name),inventors:(id,name),date,url))";

    但是,他们已经更新了他们的 API 链接:https://developer.linkedin.com/support/developer-program-transition

    据此只有这些 配置文件 API — /v1/people/~ 共享 API — /v1/people/~/shares 公司 API — /v1/companies/{id}

    端点将处于活动状态,休息需要通过 Linkedin 申请 / 与 Linked 关联的合作伙伴。

    phone-numbers,im-accounts,main-address,twitter-accounts,headline 将在 r_contactinfo 下,需要通过linkedin 申请

    【讨论】:

      【解决方案2】:

      您必须使用 positions 关键字,而不是 companies

      $xml_response = $linkedin->getProfile("~:(id,first-name,last-name,positions)");
      

      职位字段说明如下。

      https://developer.linkedin.com/docs/fields/positions

      【讨论】:

        猜你喜欢
        • 2019-05-18
        • 2012-02-25
        • 1970-01-01
        • 1970-01-01
        • 2016-01-22
        • 2019-07-13
        • 2019-08-01
        • 1970-01-01
        相关资源
        最近更新 更多