この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
google:oauth_2.0_playground [2019/02/07 06:23] ips |
google:oauth_2.0_playground [2019/02/08 00:09] (現在) ips |
||
---|---|---|---|
ライン 4: | ライン 4: | ||
[[https://qiita.com/howdy39/items/ca719537bba676dce1cf|Googleスプレッドシートをプログラムから操作]] | [[https://qiita.com/howdy39/items/ca719537bba676dce1cf|Googleスプレッドシートをプログラムから操作]] | ||
+ | |||
+ | [[https://developers.google.com/sheets/guides/batchupdate?hl=ja|スプレッドシートのアップデート]] | ||
+ | ここにシート名変更のサンプルがあった | ||
ライン 11: | ライン 14: | ||
{{:google:pasted:20190205-071040.png}} | {{:google:pasted:20190205-071040.png}} | ||
+ | ===== 調べ方 ===== | ||
+ | Http MethodをGETにする | ||
+ | Request URIに | ||
+ | <code> | ||
+ | https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}?includeGridData=trueを入力 | ||
+ | </code> | ||
+ | した値を比較する | ||
===== APIサンプル ===== | ===== APIサンプル ===== | ||
ライン 18: | ライン 28: | ||
<code> | <code> | ||
let url2 = "https://sheets.googleapis.com/v4/spreadsheets/" + this.state.spreadsheetId + ":batchUpdate" | let url2 = "https://sheets.googleapis.com/v4/spreadsheets/" + this.state.spreadsheetId + ":batchUpdate" | ||
- | let bodyString = '{"requests": [{"updateSpreadsheetProperties": {"properties": {"title": "memory2"},"fields": "title"}}]}' | + | let bodyString = '{"requests": [{"updateSpreadsheetProperties": {"properties": {"title": "ブック名"},"fields": "title"}}]}' |
</code> | </code> | ||
+ | ==== シート名の変更 ==== | ||
+ | |||
+ | <code> | ||
+ | let url2 = "https://sheets.googleapis.com/v4/spreadsheets/" + this.state.spreadsheetId + ":batchUpdate" | ||
+ | let bodyString = `{ | ||
+ | "requests": [ | ||
+ | { | ||
+ | "updateSheetProperties": { | ||
+ | "properties": {"sheetId": 0, "title": "問題"}, | ||
+ | "fields": "title" | ||
+ | } | ||
+ | }, | ||
+ | ] | ||
+ | }` | ||
+ | </code> |