0

Can't retrieve displayName and location using opensocial java api

Hi,

I am using Opensocial java api 1.0. I have got a OAuth2LeggedScheme working and I can access things like activities. So I assume the Authentication/Authorization is ok.

I would like to retrieve the displayName and the location of the user but can only manage to retrieve the gender and id. here is what i have

Attempt 1:
CODE
AuthScheme oAuthScheme = new OAuth2LeggedScheme(YAHOO_CONSUMER_KEY, YAHOO_CONSUMER_SECRET, guid);
Client client = new Client(new YahooProvider(),
Request request = PeopleService.getUser("@me");
Response resp = client.send(request);


request is: /social/rest/people/@me/@self?xoauth_requestor_id=######&oauth_consumer_key=######&oauth_signature_method=HMAC-SHA1&oauth_timestamp=######&oauth_nonce=######&oauth_version=1.0&oauth_signature=######
response is: {"entry":{"photos":[{"value":"somevalidurl","type":"thumbnail"}],"id":"thecorrectid","isViewer":false,"thumbnailUrl":"somevalidurl","isOwner":false}}

Attempt 2: I try to explicitly set the parameters I want
CODE
AuthScheme oAuthScheme = new OAuth2LeggedScheme(YAHOO_CONSUMER_KEY, YAHOO_CONSUMER_SECRET, guid);
Client client = new Client(new YahooProvider(),
Request request = PeopleService.getUser("@me");
request.setFieldsParameter(new String[]{"displayName", "gender", "id", "name", "updated", "photos"});
Response resp = client.send(request);


request is :/social/rest/people/@me/@self?fields=displayName%2Cgender%2Cid%2Cname%2Cupdated%2Cphotos&xoauth_requestor_id=######&oauth_consumer_key=######&oauth_signature_method=HMAC-SHA1&oauth_timestamp=######&oauth_nonce=######&oauth_version=1.0&oauth_signature=######
response is: {"entry":{"id":"######","isViewer":false,"isOwner":false,"gender":"male","displayName":""}}

Now according to opensocial spec I should at the very least get a non-empty displayName which I am not getting. If I try to add location to the fileds parameters array I get a HTTP 500 from yahoo.

Can anyone help here? Is this just due to poor support of OpenSocial by yahoo? I says that it supports the people endpoints

Are there any other options other than using the java opensocial api?

Any help would be greatly appreciated.

thanks
andre

by
2 Replies
  • Does the user have name on profiles.yahoo.com? The location field isn't supported.

    Thanks,
    Chirag
    0
  • sorry for the late reply.

    yes the user does have a profile. i can see the info using the yql query for example.

    QUOTE (Chirag @ Mar 26 2010, 01:55 PM) <{POST_SNAPBACK}>
    Does the user have name on profiles.yahoo.com? The location field isn't supported.

    Thanks,
    Chirag
    0

Recent Posts

in YAP