2013-11-15 72 views
5

我需要獲得一個用戶的羣體,LinkedIn API如何獲取組的詳細信息通過人民搜索

IN.API.Raw("/people-search:(people:(id,first-name,last-name,email-address,industry,summary,num-connections,headline,group-memberships:(group:(id)))?first-name=ramesh&last-name=kotha&count="+25).result(function(result, metadata) { 
//got the details here 
} 

當我使用result.values [0] .person.groupMembership.group.id它在說未定義。 如何獲取用戶組。

+0

什麼是你的請求的狀態?我得到400(不良要求) – Pinal

+0

不,我得到的結果,但出團體信息。 –

+0

它看起來像你在URL中缺少一個括號: '「/ people-search :(人名:(id,名字,姓氏,電子郵件地址,行業,摘要,數字連接,標題,團體會員:(group:(id))))?first-name = ramesh&last-name = kotha&count =「+ 25' – MarcoL

回答

5

築巢建的對象會工作的要求:

IN.API.Raw("/people-search:(people:(id,first-name,last-name,email-address,industry,summary‌,group-memberships,num-connections,headline))?first-name=ramesh&last‌​-name=kotha&count="+25) 
.result(function(result, metadata) { 
    console.log(result); 

    for(person in result.people.values){ 
     console.log(person); 
     IN.API.Raw() 
      .url("/people/" + result.people.values[person].id + "/group-memberships:(group:(id,name),membership-state)") 

     .result(function(result, metadata){ 

      console.log(result); 
      }); 

    } 


}) 
相關問題