Line 138:
Line 138:
* If you receive error "Client error: `POST https://oauth2.googleapis.com/token` resulted in a `401 Unauthorized` response: { 'error': 'unauthorized_client', 'error_description': 'Client is unauthorized to retrieve access tokens using this (truncated...)":
* If you receive error "Client error: `POST https://oauth2.googleapis.com/token` resulted in a `401 Unauthorized` response: { 'error': 'unauthorized_client', 'error_description': 'Client is unauthorized to retrieve access tokens using this (truncated...)":
** If you have a free Gmail account, disable the option "Add also list of attendees into event." (not supported with such accounts).
** If you have a free Gmail account, disable the option "Add also list of attendees into event." (not supported with such accounts).
−
** If you have the Google Suite, you can also disable the option "Add also list of attendees into event" (recent version of Google API does not support this very well), or, you can try to "Authorize the service account to access data on behalf of a user" as explained on Google doc: https://support.google.com/a/answer/162106?hl=en&fl=1&sjid=4000630194749189449-NA, chapter "Set up domain-wide delegation for a client". This is the summary here:
+
** If you have the Google Suite, you can also disable the option "Add also list of attendees into event" (recent version of Google API does not support this very well), or, you can try to "Authorize the service account to access data on behalf of a user" as explained on Google doc: https://support.google.com/a/answer/162106?hl=en&fl=1&sjid=4000630194749189449-NA, chapter "Set up domain-wide delegation for a client". This is the summary here: Go to Menu Security > Access and data control > API controls > Manage Domain Wide Delegation. Click Add new. Enter the Client ID for either the service account or the OAuth2 client. In OAuth Scopes, add the scopes https://www.googleapis.com/auth/calendar and https://www.googleapis.com/auth/calendar.events. Click Authorize. If you get an error, the client ID might not be registered with Google or there might be duplicate or unsupported scopes. Wait 24h and try again.
−
- Go to Menu Security > Access and data control > API controls > Manage Domain Wide Delegation.
−
- Click Add new.
−
- Enter the Client ID for either the service account or the OAuth2 client.
−
- In OAuth Scopes, add the scopes https://www.googleapis.com/auth/calendar and https://www.googleapis.com/auth/calendar.events.
−
- Click Authorize. If you get an error, the client ID might not be registered with Google or there might be duplicate or unsupported scopes.
−
- Wait 24h.
* If you receive error "ERROR { 'error': { 'code': 403, 'message': 'Google Calendar API has not been used in project ... before or it is disabled...": Check the step 1 was done.
* If you receive error "ERROR { 'error': { 'code': 403, 'message': 'Google Calendar API has not been used in project ... before or it is disabled...": Check the step 1 was done.