この文書の現在のバージョンと選択したバージョンの差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
|
google:oauth_2.0_playground [2019/02/05 07:11] 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|スプレッドシートのアップデート]] | ||
| + | ここにシート名変更のサンプルがあった | ||
| ライン 10: | ライン 13: | ||
| {{: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サンプル ===== | ||
| + | |||
| + | ==== ブック名の変更 ==== | ||
| + | |||
| + | <code> | ||
| + | let url2 = "https://sheets.googleapis.com/v4/spreadsheets/" + this.state.spreadsheetId + ":batchUpdate" | ||
| + | let bodyString = '{"requests": [{"updateSpreadsheetProperties": {"properties": {"title": "ブック名"},"fields": "title"}}]}' | ||
| + | </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> | ||