Parsing response for osapi.http.get calls

116 views
Skip to first unread message

deJu

unread,
Jan 5, 2011, 6:40:03 PM1/5/11
to Twitter Development Talk
Hello,

Does the Twitter API fully support the osapi.http methods defined in
the OpenSocial 0.9+ spec?

When I use the older (now deprecated) method
"gadgets.io.makeRequest(url, callback, params)" and I haven't yet
granted access to the gadget, the object returned contains
response.oauthApprovalUrl, which is where I redirect the user to.

However, when I use osapi.http.get(params).execute(callback) and I
haven't yet granted access to the gadget, the returned JSON object
just informs of a generic error:

[{"id":"http.get","error":{"message":"internalError: String index out
of range: 0","code":500}}]


Here's the exact code I'm calling:

var callback = function(response) {
if (response.oauthApprovalUrl) { ... }
};

osapi.http.get({
'href' : 'http://api.twitter.com/1/account/
verify_credentials.json',
'format' : 'json',
'authz' : 'oauth',
'oauth_service_name' : 'twitter'
}).execute(callback);

It seems to me that the Twitter API isn't returning the proper
information. Any ideas?

Thanks,
Dennis

Murali

unread,
Jan 27, 2011, 1:26:49 AM1/27/11
to Twitter Development Talk
>> older (now deprecated) method "gadgets.io.makeRequest(url, callback, params)

It is older all right, but where does it say it is deprecated?
Reply all
Reply to author
Forward
0 new messages