简体   繁体   English

Linkedin API-获取完整数据

[英]Linkedin API - get full data

I try to make an script to get data from LINKEDIN, i am able to get many of information about profile like name, mail, phone, picture url and so on, unfortunately how ever I try I can't get to informations like work experience and many other. 我尝试制作一个脚本来从LINKEDIN获取数据,我能够获得许多有关个人资料的信息,例如姓名,邮件,电话,图片url等,不幸的是,我怎么尝试都无法获得工作经验等信息还有很多其他

My Request looks like: 我的请求如下所示:

   $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)");

This work correctly, but lets try to add companies 这项工作正常,但是请尝试添加公司

Error: 错误:

I added it at the end of $linkedin->getProfile and here is the error message what I get: 我在$linkedin->getProfile的末尾添加了它,这是我得到的错误消息:

[message] => Unknown field {companies} in resource {Person} [消息] =>资源{人}中的未知字段{companies}

Full function looks like: 全功能看起来像:

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;
}

Documentation I found (but didn't help me ) 我找到的文档(但没有帮助我)
https://developer.linkedin.com/docs/fields https://developer.linkedin.com/docs/fields

I expect I miss something really stupid but cant figurate it out, can somone help me? 我希望我能错过一些真正愚蠢的事情,但无法弄清楚,我能帮助我吗?

LinkedIn provided all these fields before May 12th 2015. 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 ," + https://api.linkedin.com/v1/people/~:(id,名字,姓氏,电子邮件地址,图片网址,行业,协会,兴趣,数字建议,出生日期,荣誉奖,三个当前职位,三个过去职位,志愿者,位置 ,“ +

"positions:(id,title,summary,start-date,end-date,is-current,company:(id,name,type,size,industry,ticker))," + “职位:(id,标题,摘要,开始日期,结束日期,当前公司:(id,名称,类型,大小,行业,股票行情)),” +

"educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes)," + “教育:(身份证,学校名称,学习领域,开始日期,结束日期,学位,活动,说明),” +

"publications:(id,title,publisher:(name),authors:(id,name),date,url,summary),"+ “出版物:(id,标题,发布者:(name),作者:(id,name),日期,url,摘要),” +

"languages:(id,language:(name),proficiency:(level,name)),"+ “语言:(id,语言:(名称),熟练程度:(级别,名称)),” +

"skills:(id,skill:(name)))"; “技能:(id,技能:(名称)))”;

"courses:(id,name,number),"+ “课程:(id,name,number),” +

"recommendations-received:(id,recommendation-type,recommendation-text,recommender))"; “收到的建议:(id,建议类型,建议文本,建议))”;

"patents:(id,title,summary,number,status:(id,name),office:(name),inventors:(id,name),date,url))"; “专利:(id,标题,摘要,编号,状态:(id,名称),办公室:(名称),发明人:(id,名称),日期,URL))”;

But, they have updated their APIs link: https://developer.linkedin.com/support/developer-program-transition 但是,他们已经更新了API链接: https : //developer.linkedin.com/support/developer-program-transition

According to which only these Profile API — /v1/people/~ Share API — /v1/people/~/shares Companies API — /v1/companies/{id} 仅根据这些配置文件API-/ v1 / people /〜Share API-/ v1 / people /〜/ shares公司API-/ v1 / companies / {id}

endpoints will be active, Rest require a Apply with Linkedin /Partner with Linked association. 端点将处于活动状态,Rest需要使用Linkedin的应用程序/具有链接关联的伙伴。

phone-numbers,im-accounts,main-address,twitter-accounts,headline would come under r_contactinfo which needs a Apply with linkedin 电话号码,IM帐户,主要地址,Twitter帐户,标题将位于r_contactinfo下,需要使用Linkedin进行申请

Instead of companies , you must use positions keyword. 除了companies ,您必须使用positions关键字。

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

Positions field description in the following address. 将字段描述放在以下地址中。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM