I need to get the groups of an user,
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
}
when i use result.values[0].person.groupMembership.group.id it is saying undefined. How to get the groups of a user.
Nesting the requests to build the objects would work:
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);
});
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With