I'm deploying an in-house Gmail contextual gadget from an existing code. Have deployed the gadget in my google apps domain by refering this document : https://developers.google.com/apps-marketplace/preparing
function makeRequest(){
var params = {};
params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;
params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
params[gadgets.io.RequestParameters.OAUTH_SERVICE_NAME] = "HMAC";
params[gadgets.io.RequestParameters.REFRESH_INTERVAL] = 3600;
var url = "https://applicationid.appspot.com/user/" + sender_name;
gadgets.io.makeRequest(url, onResponse, params);
}
function onResponse(response) {
if (response.rc != 200) {
document.getElementById('profile-container').innerHTML = 'Service temporarily unavailable.';
gadgets.window.adjustHeight();
} else {
document.getElementById('profile-container').innerHTML = response.text;
gadgets.window.adjustHeight();
}
}
But here response.rc
always returning status code as 500. And gadgets.io.makeRequest()
function doesn't make any request to the url (application hosted on appengine). It seems like the issue with SIGNED Authorization
. How to implement SIGNED Authorization
in Gmail Gadget?