Let's say I have a thousand friends who all use my app. I want to one-off from script pull a friend by ID from collection of friends.
The docs say:
An ID, array of IDs, or a group
reference used to specify which people to fetch; the supported keys are
VIEWER, OWNER, VIEWER_FRIENDS, OWNER_FRIENDS, or a single ID within one
of those groups.
" single ID within one
of those groups " this would be valid for one of my friends within owner friends. Am I misunderstanding the whole thing?
I've seen forum posts asking how to get information from
non-friends, but nothing explicitly answering the question: "Can I pull
a single friend from OWNER_FRIENDS".
Sample Code:
<script type="text/javascript">
function onDataResponse(data) {
var d_person = data.get('person');
if (data.hadError()) {
alert(d_person.getErrorMessage());
}
else {
var friend = d_person.getData();
alert(friend);
}
}
var req = opensocial.newDataRequest();
var ids = ["357590058"];
req.add(req.newFetchPeopleRequest(ids), 'person');
req.send(onDataResponse);
</script>