使用 Google API 删除事件 - 通知“来自”来自管理员帐户

发布于 2025-01-19 15:21:57 字数 810 浏览 1 评论 0 原文

我目前正在研究一个Nest JS项目,该项目利用Google节点软件包从用户日历(GCAL)删除事件。 GCAL成功删除了会议,但是删除通知会议来自API用于连接的管理帐户。 有没有办法使发送给与会者的通知别名,因此看来日历的所有者发送了通知,而不是Google API管理员?

节点包 https://www.npmjs.com/package/package/google

Google api api delete文档

这是代码段

// https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#delete
  await this.calendar.events.delete({
    calendarId,
    eventId,
    sendNotifications: true,
    sendUpdates: 'all',
  });

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',
  });

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哭了丶谁疼 2025-01-26 15:21:57
  • Google 日历将根据经过身份验证的参与者触发相应的通知。
  • 在您的场景中,这将是“api 用于连接的管理帐户”
  • 如果您在工作空间环境中使用此自动化脚本,您可能需要模拟其他用户(例如活动组织者)来删除活动。
  • 要在工作区场景中实现这一目标,您需要域范围委派权限设立。

注意:确保经过身份验证的用户(和/或删除调用的执行者)对受影响的事件拥有足够的权限,以便将其删除或使用具有日历管理员角色(或超级管理员)的帐户。

  • 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文