The spreadsheets API does not expose revisions of sheets, those are only
available via the Documents List API.  What you get with the spreadsheets
API is the latest instance of all data.

To answer your other question though, pass in an If-Match: * header to skip
etags, which essentially ensure update operations don't conflict with one
another.  This will force the change through.

-Vic



On Sat, Jun 4, 2011 at 9:18 AM, GrĂ©goire Seux <[email protected]>wrote:

> 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