google calendar api

2023-10-04 18:05
2023-10-04 19:06

Google Calendar API に関するメモ

公式ドキュメント: Google Calendar API の概要  |  Google for Developers

主なリソース

  • イベント: タイトル、開始時刻、終了時刻、参加者などの情報を含むカレンダー上のイベント
  • カレンダー: イベントのコレクション
  • カレンダーリスト
  • 設定
  • ACL

基本的な操作

環境のセットアップ

$ ACCESS_TOKEN=`gcloud auth print-access-token`
$ CALENDAR_ID=abacc9c9216e5c609fece4ceca8bd3dd2c1579867f60c8d657e3fa8a3e6ed2a5@group.calendar.google.com

$ curl --request GET "https://www.googleapis.com/calendar/v3/calendars/${CALENDAR_ID}/events" \
        --header "Authorization: Bearer $ACCESS_TOKEN" \
        --header 'Accept: application/json' \
        --header 'Content-Type: application/json' \
        --data '{start":{"dateTime":"2021-01-11T21:00:00+09:00"},"end":{"dateTime":"2021-01-11T23:00:00+09:00"},""summary":"Google Calendar API TEST"}' \
        --compressed
{
 "kind": "calendar#events",
 "etag": "\"p33ccd5c4hfeo20o\"",
 "summary": "超ときめき♡宣伝部イベント",
 "description": "",
 "updated": "2023-10-04T19:05:23.975Z",
 "timeZone": "Asia/Tokyo",
 "accessRole": "owner",
 "defaultReminders": [],
 "nextSyncToken": "CNjGlYSL3YEDGAUgwt7gjwI=",
 "items": [
  {
   "kind": "calendar#event",
   "etag": "\"3392892646714000\"",
   "id": "76pv5n8o64l7s40mrutdfttljf",
   "status": "confirmed",
   "htmlLink": "https://www.google.com/calendar/event?eid=NzZwdjVuOG82NGw3czQwbXJ1dGRmdHRsamYgYWJhY2M5YzkyMTZlNWM2MDlmZWNlNGNlY2E4YmQzZGQyYzE1Nzk4NjdmNjBjOGQ2NTdlM2ZhOGEzZTZlZDJhNUBn",
   "created": "2023-10-04T19:03:26.000Z",
   "updated": "2023-10-04T19:05:23.357Z",
   "summary": "テストイベント",
   "description": "コメント",
   "location": "山野ホール",
   "creator": {
    "email": "gomi2ngen@gmail.com"
   },
   "organizer": {
    "email": "abacc9c9216e5c609fece4ceca8bd3dd2c1579867f60c8d657e3fa8a3e6ed2a5@group.calendar.google.com",
    "displayName": "超ときめき♡宣伝部イベント",
    "self": true
   },
   "start": {
    "dateTime": "2023-10-12T12:00:00+09:00",
    "timeZone": "Asia/Tokyo"
   },
   "end": {
    "dateTime": "2023-10-12T13:00:00+09:00",
    "timeZone": "Asia/Tokyo"
   },
   "transparency": "transparent",
   "iCalUID": "76pv5n8o64l7s40mrutdfttljf@google.com",
   "sequence": 1,
   "attendees": [
    {
     "email": "julia_an@tokiken.com",
     "displayName": "杏ジュリア",
     "responseStatus": "needsAction"
    },
    {
     "email": "kanami_tsujino@tokiken.com",
     "displayName": "辻野かなみ",
     "responseStatus": "needsAction"
    }
   ],
   "hangoutLink": "https://meet.google.com/qcc-snoa-wiw",
   "conferenceData": {
    "entryPoints": [
     {
      "entryPointType": "video",
      "uri": "https://meet.google.com/qcc-snoa-wiw",
      "label": "meet.google.com/qcc-snoa-wiw"
     }
    ],
    "conferenceSolution": {
     "key": {
      "type": "hangoutsMeet"
     },
     "name": "Google Meet",
     "iconUri": "https://fonts.gstatic.com/s/i/productlogos/meet_2020q4/v6/web-512dp/logo_meet_2020q4_color_2x_web_512dp.png"
    },
    "conferenceId": "qcc-snoa-wiw"
   },
   "reminders": {
    "useDefault": false
   },
   "eventType": "default"
  }
 ]
}

Google Calendar と Google Spreadsheet の連携

TODO

Copyright © 53ningen.com