无法从LinkedIn API获取全部信息 [英] Unable to get entire information from linkedIn api

查看:183
本文介绍了无法从LinkedIn API获取全部信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试过了

HTML

<a id="li_ui_li_gen_1432549871566_0-link" class="" href="javascript:void(0);" onclick="onLinkedInLoad();" style="margin-bottom: 20px;">

JS代码:

function onLinkedInLoad(logintype) {

  IN.User.authorize(function(){
          callback();
  });      

}
function callback(){
        IN.Event.on(IN, "auth", OnLinkedInAuth);
        OnLinkedInAuth();
}
function OnLinkedInAuth(){     

    IN.API.Profile("me")
.fields("firstName", "lastName", "industry", "location:(name)", "picture-url", "headline", "summary", "num-connections", "public-profile-url", "distance", "positions", "email-address", "educations:(id,school-name,field-of-study,start-date,end-date,degree,activities,notes)","languages:(id,language:(name),proficiency:(level,name))","skills:(id,skill:(name))", "date-of-birth")
.result(ShowProfileData)
.error(displayProfilesErrors);    
}

function ShowProfileData(profiles) {
    console.log(profiles); return false;

    //its gives me json responce 
    /*   {
        "_total": 1,
        "values": [{
          "_key": "~",
          "distance": 0,
          "emailAddress": "xxxxx@gmail.com",
          "firstName": "xxxx",
          "headline": "xxxxx",
          "industry": "Information Technology and Services",
          "lastName": "xxx",
          "location": {"name": "xxx Area, India"},
          "numConnections": 117,
          "positions": {
            "_total": 1,
            "values": [{
              "company": {
                "id": xxxxx,
                "industry": "E-Learning",
                "name": "xxxx",
                "size": "501-1000 employees",
                "type": "Privately Held"
              },
              "id": 485779823,
              "isCurrent": true,
              "startDate": {
                "month": 2,
                "year": 2013
              },
              "title": "xxxxx"
            }]
          },
          "publicProfileUrl": "https://www.linkedin.com/pub/xxxxx/xx/xx/xx"
        }]
      } */      
}
function displayProfilesErrors(error) {
    profilesDiv = document.getElementById("profiles");
    profilesDiv.innerHTML = error.message;
    console.log(error);
}

推荐答案

在我看来,某些查询字段(例如语言,技能,教育领域)要求您的应用程序已被批准使用通过LinkedIn申请"程序.

It looks to me that some queried fields (e.g. languages, skills, education fields) require that your application have been approved for the Apply with LinkedIn program.

请参阅:配置文件字段描述页,其中列出了需要其他API的字段(即会员"个人资料字段,可使用具有LinkedIn开发人员标题的Apply进行申请),并查看如何使用此API进行申请:

See: Profile field descriptions page which lists fields that require an additional API (i.e. 'Member profile fields available to Apply with LinkedIn developers' title), and see how one can apply for using this API: Request access to this API page.

这篇关于无法从LinkedIn API获取全部信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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