🔒 Protected via Cloudflare Access

calendar.api.ready — Draft Seed

Content (1,987 chars)

Confirm calendar API access is working for this session. Identify which provider is available — Google Calendar API, Microsoft Graph, or CalDAV — then verify accordingly.

For Google Calendar: check for valid OAuth2 credentials with at least calendar.events.readonly scope (check calendar.events or calendar for write operations downstream). Test by calling GET /calendar/v3/users/me/calendarList — this confirms auth, identity, and returns all accessible calendars in one call. If you get 403 with "Calendar API has not been used in project," the API isn't enabled in the GCP console. If the OAuth consent screen blocks with "unverified app," report that — the user needs to publish or add test users.

For Microsoft Graph: check for a valid OAuth2 token with Calendars.Read scope (Calendars.ReadWrite for mutations downstream). Test by calling GET /me/calendars. If you get 403, check whether admin consent is required — application permissions need tenant admin approval. If you get "MailboxNotEnabledForRESTAPI," the user has no Exchange Online mailbox and Graph calendar won't work.

For CalDAV: connect over HTTPS to the server's well-known endpoint (PROPFIND /.well-known/caldav) and follow the redirect to the context path. Then PROPFIND with Depth:0 requesting current-user-principal to confirm auth. Common context paths: /dav/ (generic), /remote.php/dav/ (Nextcloud), /caldav/v2/ (Google). If the DAV response header lacks "calendar-access," the server doesn't support CalDAV. Google's CalDAV requires OAuth2 — basic auth will return 401.

For any provider: if the token is expired, report expiry time and granted scopes. If credentials are missing entirely, report which provider was detected and link to its quickstart docs. Do not attempt to re-authenticate or refresh tokens — that's the user's responsibility. Cache the provider name, authenticated identity, list of calendar IDs with display names and access roles (owner/writer/reader), and the default/primary calendar ID. This check should complete in under 10 seconds per provider.

Expected Conjugation

Design Notes