Skip to content
Advertisement

Getting google calendar, “Service accounts cannot invite attendees without Domain-Wide Delegation of Authority.”

I can create events but when add attendees it returns this error i followed google guide and every thing is done but i can’t figure out what the problem

My code

JavaScript

I’m using google-api-php-client

the error:

GoogleServiceException: { “error”: { “errors”: [ { “domain”: “calendar”, “reason”: “forbiddenForServiceAccounts”, “message”: “Service accounts cannot invite attendees without Domain-Wide Delegation of Authority.” } ], “code”: 403, “message”: “Service accounts cannot invite attendees without Domain-Wide Delegation of Authority.” } } in C:wampwwwbbb.portal.pfhcheckups.comappgoogle-apisrcHttpREST.php on line 128

Advertisement

Answer

Service accounts cannot invite attendees without Domain-Wide Delegation of Authority

Means exactly that. Only service accounts which have had domain wide delegation set up on the Gsuite (WorkSpace) domain can invite people to events.

Ask your Gsuite admin to set up domain wide delegation to the service account. If you dont have a gsuite domain either get one or use Oauth2 to authenticate a user instead of service accounts.

If you have delegated domain-wide access to the service account and you want to impersonate a user account, specify the email address of the user account using the method setSubject:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement