google-calendar
Drive Google Calendar via curl + jq. The user's OAuth bearer token
is in $GOOGLE_CALENDAR_TOKEN; every call needs it as
Authorization: Bearer $GOOGLE_CALENDAR_TOKEN. At minimum the token
carries calendar.readonly plus the identity scopes
(openid email profile); if the user opted in to write at install
time it also carries the broader calendar scope (read + write).
The Calendar API returns standard JSON; failures surface as
{"error": {"code": 401|403|..., "message": "..."}} — show that
error verbatim. 401 means the token expired (re-install). 403 insufficientPermissions on a write means the user only granted
calendar.readonly — ask them to re-install the connector with the
read+write box checked.
Always start with users/me/calendarList to learn which calendars
the account can see (the user's primary plus any subscribed / shared
ones), AND with users/me/settings/timezone so you render times in
the user's local zone instead of UTC.