I've a service account credential, and can initialize it, read calendars, create events, but cannot invite users from their emails (@gmail.com)
I get the following error "Service accounts cannot invite attendees without Domain-Wide Delegation of Authority."
This service account has wide domain access, with all the scopes
I initialize the auth and calendar client
import { Auth } from 'googleapis'
import { GaxiosError } from 'googleapis-common'
import { calendar, calendar_v3 } from 'googleapis/build/src/apis/calendar'
const auth = new Auth.GoogleAuth({
keyFile: 'service_account_credentials.json',
scopes: [
'https://www.googleapis.com/auth/calendar'
]
})
const calendar_ = calendar({ version: 'v3', auth: auth })
When I try to create an event, it throws an error about the Domain-Wide Delegation.
calendar_.events.insert(
{
calendarId: _calendarId,
conferenceDataVersion: 0,
maxAttendees: 2,
supportsAttachments: false,
sendNotifications: true,
sendUpdates: 'all',
requestBody: {
attendees: [
{ email: 'testmail@gmail.com'}
],
description: 'automatic event',
....
}
}
)
Are there any other steps must be followed to remove this restriction? i have admin access
If attendees is an empty array, the event is created without any trouble
@CarlosVi wrote:attendees: [ { email: 'testmail@gmail.com'} ],
@CarlosVi I'm having the same problem, have you found a solution? I searched the web and tried out every suggestion I could find, but no luck.
I have the same issue, did you found something?