Hello,

I would like to update a spreadsheet from php using curl.

But it does not seem to behave as expected : first when i retrived data I 
get an edit link without the revision id.

<link rel="self" type="application/atom+xml" 
href="https://spreadsheets.google.com/feeds/list/tlRcYTfTsMvpNEEUKA9Aayg/od6/private/full/cokwr"/>
<link rel="edit" type="application/atom+xml" 
href="https://spreadsheets.google.com/feeds/list/tlRcYTfTsMvpNEEUKA9Aayg/od6/private/full/cokwr"/>

Second, when I try to update (with the real edit link that i can get 
directly by requesting the self in a browser) I get the "Unexpected resource 
version ID" error.
My code is below : 

$ch = curl_init();

$headers = array("Authorization: GoogleLogin auth=".$token, "GData-Version: 
3.0"); 

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$file = tmpfile(); 

fwrite($file, $string); 

fseek($file, 0); 

curl_setopt($ch, CURLOPT_INFILE, $file); 

curl_setopt($ch, CURLOPT_INFILESIZE, strlen($string));

curl_setopt($ch, CURLOPT_PUT, true);

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$bob = curl_exec($ch);

fclose($file);

echo $bob;



Does anyone has a clue about what's going on ? 
Thanks a lot for any reply :-) !

Greg 

Reply via email to