5

我需要获取用户的组,

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时,它说的是未定义。如何获取用户的组。

4

1 回答 1

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

    }


})
于 2013-11-22T02:33:26.473 回答