Last active
November 7, 2015 11:21
-
-
Save sakadon/228dd5748a6abb0af810 to your computer and use it in GitHub Desktop.
Google APIs Client Library for PHPでgd:etagを取得する ref: http://qiita.com/sakadon/items/34552fb99669d6879466
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sheet_id = '#########'; | |
$request = new Google_Http_Request( | |
"https://spreadsheets.google.com/feeds/worksheets/{$sheet_id}/private/full?alt=json", | |
"GET", | |
array( | |
"Authorization" => "Bearer {$this->token}", | |
"GData-Version" => "3.0" | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stdClass Object | |
( | |
[version] => 1.0 | |
[encoding] => UTF-8 | |
[feed] => stdClass Object | |
( | |
[xmlns] => http://www.w3.org/2005/Atom | |
[xmlns$openSearch] => http://a9.com/-/spec/opensearch/1.1/ | |
[xmlns$gs] => http://schemas.google.com/spreadsheets/2006 | |
[xmlns$gd] => http://schemas.google.com/g/2005 | |
[gd$etag] => W/"AAAAAAAAAAAAAAAAAAAAAAA." | |
[id] => stdClass Object | |
( | |
[$t] => https://spreadsheets.google.com/feeds/worksheets/シートID/private/full | |
) | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gs="http://schemas.google.com/spreadsheets/2006" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended" gd:etag='"AAAAAAAAAAAAAAAAAAAAAAA."'> | |
<category scheme="http://schemas.google.com/spreadsheets/2006" term="http://schemas.google.com/spreadsheets/2006#list"/> | |
<id>{$lineid}</id> | |
<link rel="self" type="application/atom+xml" href="{$selfhref}"/> | |
<link rel="edit" type="application/atom+xml" href="{$edithref}"/> | |
<gsx:headname>Update</gsx:use> | |
</entry> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$request = new Google_Http_Request( | |
$edithref, | |
"PUT", | |
array( | |
"Authorization" => "Bearer {$accessToken}", | |
"Content-Type" => "application/atom+xml", | |
'GData-Version' => "3.0" | |
), | |
$postBody // <= ↑のXML | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment