I want to write back to my google spreadsheet after authorizing user.
Authorizing is complete. But, to write back to spreadsheet, I have send PUT
request as stated
here<http://code.google.com/apis/spreadsheets/data/3.0/developers_guide.html#UpdatingCells>.
It is from iGoogle Gadget.
My XML element is :
var cellUrl = "https://spreadsheets.google.com/feeds/cells/" + key +
"/od6/private/full/R2C2";
var XMLData = "<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:gs='http://schemas.google.com/spreadsheets/2006'>" +
"<id>" + cellUrl + "</id><link rel='edit'
type='application/atom+xml' href='" + cellUrl + "'/>" +
"<gs:cell row='2' col='2' inputValue='300'/>" +
"</entry>";
I am sending AJAX request as :
$.ajax({
url: cellUrl,
type: "PUT",
contentType: 'application/atom+xml',
processData: false,
data: XMLData,
error: function(XMLHttpRequest, textStatus,
errorThrown){
alert(errorThrown);
}, success: function(data, textStatus, XMLHttpRequest){
alert("Succeeded");
}
});
It is showing me error :
OAuth error: undefined: ==== Original request: PUT
/feeds/cells/0Aq69FHX3TV4ndDBDVFFETUFhamc5S25rdkNoRkd4WXc/od6/private/full/R6C6
Host: spreadsheets.google.com X-Shindig-AuthType: oauth X-Forwarded-For:
121.243.28.42 X-shindig-dos: on ==== ==== Sent request 1: PUT
/feeds/cells/0Aq69FHX3TV4ndDBDVFFETUFhamc5S25rdkNoRkd4WXc/od6/private/full/R6C6
Host: spreadsheets.google.com X-Shindig-AuthType: oauth Authorization: OAuth
oauth_body_hash="2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D",
opensocial_owner_id="110501559172399061294",
opensocial_viewer_id="110501559172399061294",
opensocial_app_id="105457509408870268642",
opensocial_app_url="http%3A%2F%2Fhosting.gmodules.com%2Fig%2Fgadgets%2Ffile%2F112285678925209781527%2Fg1.xml",
xoauth_signature_publickey="pub.1210278512.2713152949996518384.cer",
xoauth_public_key="pub.1210278512.2713152949996518384.cer",
oauth_version="1.0", oauth_timestamp="1295855527",
oauth_nonce="7702046626580960959",
opensocial_container="http%3A%2F%2Fwww.google.com%2Fig",
oauth_token="1%2FEns5kIMBSws15fiatbQ_auH11bq2epY7iHnicnmmffo",
oauth_consumer_key="www.google.com", oauth_signature_method="RSA-SHA1",
oauth_signature="bJMD5iPj9NRhCaH30p%2FfX3AZk1GWBU6BcTZeZIwLLgTZB09LhxOmsh8Dax%2BUEUMJpEp8lZ7fVvePq5qDc2XJmFVGsau9DXrDM2RJ66HuYS7pQINRGK%2FUxoGGtXCEQMaz7eSmjNxqasRZQkNRo5qx2M7aeCB7qmBFM3D0YbB6wTM%3D"
X-Forwarded-For: 121.243.28.42 X-shindig-dos: on ==== Received response 1:
HTTP/1.1 415 Cache-Control: private, max-age=0 Content-Type: text/html;
charset=UTF-8 Date: Mon, 24 Jan 2011 07:52:07 GMT Expires: Mon, 24 Jan 2011
07:52:07 GMT Server: GSE Via: HTTP/1.1 GWA X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN X-Google-Cache-Control: remote-fetch
X-XSS-Protection: 1; mode=block Content-Type
application/x-www-form-urlencoded;charset=utf-8 is not a valid input type.
====
I have hidden cellURL key for security. And it is similar to the key in my
spreadsheet url.