|
RequestingDetailedProfileInformation
How to request profile fields beyond the standard ID, NAME, and THUMBNAIL_URL
IntroductionThe OpenSocial API only returns a limited amount of profile information about users by default. To request additional fields, you need to specify the opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS parameter when constructing your request. For a list of what fields may be requested, please check here. DetailsThis example requests the ABOUT_ME and ACTIVITIES fields in Orkut. It uses the CodeRunner output function. function response(data) {
var viewer = data.get("viewer_profile").getData();
var aboutme = viewer.getField(opensocial.Person.Field.ABOUT_ME);
var activities = viewer.getField(opensocial.Person.Field.ACTIVITIES);
output(aboutme);
output(activities);
};
function request() {
var req = opensocial.newDataRequest();
var params = {};
params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [
opensocial.Person.Field.ABOUT_ME,
opensocial.Person.Field.ACTIVITIES
];
req.add(req.newFetchPersonRequest("VIEWER", params), "viewer_profile");
req.send(response);
};
request();
|
Sign in to add a comment

i have tried the same code but it still returns null values visit the link http://www.sandbox.orkut.co.in/Application.aspx?uid=5325687833660916649&appId=1028370445473&bpc=1