youtube
Call the YouTube Data API v3 with curl + jq. The user's OAuth bearer
token is in $GOOGLE_YOUTUBE_TOKEN; every call needs it as
Authorization: Bearer $GOOGLE_YOUTUBE_TOKEN. Base URL:
https://www.googleapis.com/youtube/v3.
The token always carries youtube.readonly plus identity scopes
(openid email profile); if the user opted in at install it also
carries youtube.upload (publish videos).
Responses are standard JSON; failures surface as
{"error": {"code": 401|403|..., "message": "..."}} — show that error
verbatim. 401 → token expired, the user must re-connect the YouTube
connector. 403 insufficientPermissions on an upload → the user did
not grant youtube.upload; ask them to re-connect with the upload box
checked.
Always start with the channel check to confirm the connection works and learn which channel you're operating against.