doufang8965 2015-09-23 07:01
浏览 78

无法从linkedIn api获取完整信息

I have tried this

Html:

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

JS code:

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);
}
  • 写回答

1条回答 默认 最新

  • drddx3115 2015-10-16 12:26
    关注

    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.

    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.

    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?