有没有办法邀请组织外的与会者?

Is there a way to invite attendees outside the organization?

我已阅读 google 日历 API 文档,但我找不到邀请帐户组织外部访客的方法,这可能吗?

这是我的 NodeJS 客户端代码:

const auth = new google.auth.GoogleAuth({
  keyFile: 'src/google-api/calendar-auth.json',
  scopes: ['https://www.googleapis.com/auth/calendar'],
});

const calendar = google.calendar({ version: 'v3', auth });

calendar.events.insert({
    calendarId: 'email-of-organization',
    sendUpdates: 'all',
    requestBody: {
        start: {
          dateTime: startDate.toISOString(),
          timeZone: 'utc',
        },
        end: {
          dateTime: endDate.toISOString(),
          timeZone: 'utc',
        },
        summary: 'a summary',
        description: 'a description',
        attendees: [{ email: 'email@outside.org' }], // this email is outside my organization
    },
});

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

即使我设置了全域委派,错误仍然存​​在。

基本上,当您将域范围的权限委托给您的服务帐户时,您授权您的服务帐户代表您域中的用户访问数据。参见 Delegating domain-wide authority to the service account

Once you finished delegating domain-wide authority, your application now has the authority to make API calls as users in your domain (to "impersonate" users). When you prepare to make authorized API calls, you specify the user to impersonate.

可以邀请域外的来宾(使用您的用户帐户或服务帐户)。您可以选择在邀请域外的访客时警告用户。参见 Allow external invitations in Google Calendar events

我尝试使用我的用户帐户创建活动并使用 events.insert 从域外添加来宾。它已成功创建。因此,如果您让您的服务帐户模拟您域中的用户,它应该也能够创建活动并邀请您域外的来宾