'Deleting Events using Google API - Notifications 'From' coming from Admin account
I am currently working on a nest JS project that leverages the google node package to delete an event from a users calendar (gcal). Gcal successfully deletes the meeting, but the deletion notification to attendees comes from the administration account the api uses to connect. Is there a way to alias the notification that is sent out to attendees so it looks like the owner of the calendar sent out the notification, not the google api administrator?
node package https://www.npmjs.com/package/google
google api delete docs https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#delete
This is the code snippet
// https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#delete
await this.calendar.events.delete({
calendarId,
eventId,
sendNotifications: true,
sendUpdates: 'all',
});
Solution 1:[1]
- Google Calendar will trigger the respective notifications based on the authenticated actor.
- In your scenario, that will be
"administration account the api uses to connect"
. - If you are using this automation script in a Workspace Environment, you may want to impersonate another user (like the event organizer for example) to delete the event.
- To achieve that in a Workspace scenario, you will need Domain-Wide Delegation of Authority set up.
NOTE: Make sure the authenticated user (and/or the actor of the delete call) has enough permissions over the affected event in order to delete it or use an account with Calendar Admin role (or Super Admin).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Gustavo |