选择 Google Calendar API 范围

本文档包含特定于 Google Calendar API 的授权和身份验证信息。在阅读本文档之前,请务必先阅读 了解身份验证和授权,了解 Google Workspace 的一般身份验证和授权信息。

配置 OAuth 2.0 以进行授权

配置 OAuth 权限请求页面并选择范围,以定义向用户和应用审核者显示哪些信息,并注册应用以便以后发布。

Calendar API 范围

如需定义授予应用的访问权限级别,您需要确定并声明授权范围。授权范围是一个 OAuth 2.0 URI 字符串,其中包含 Google Workspace 应用名称、应用访问的数据类型以及访问权限级别。范围是您的应用对使用 Google Workspace 数据(包括用户的 Google 账号数据)的请求。

当应用安装完毕后,系统会要求用户验证应用使用的范围。一般来说,您应尽可能选择范围最窄的权限,并避免请求应用不需要的权限。用户更乐意向描述清晰的有限范围授予访问权限。

Calendar API 支持以下范围:

范围 含义
https://www.googleapis.com/auth/calendar 查看、修改、共享以及永久删除您使用 Google 日历可以访问的所有日历。
https://www.googleapis.com/auth/calendar.readonly 查看和下载您使用 Google 日历可以访问的任何日历。
https://www.googleapis.com/auth/calendar.freebusy 查看您日历中的空闲时间。
https://www.googleapis.com/auth/calendar.events 查看和修改您在所有日历上的活动。
https://www.googleapis.com/auth/calendar.events.readonly 查看您在所有日历上的活动。
https://www.googleapis.com/auth/calendar.settings.readonly 查看日历设置。
https://www.googleapis.com/auth/calendar.addons.execute 作为日历插件运行。
https://www.googleapis.com/auth/calendar.addons.current.event.read 查看您在 Google 日历中打开的活动。
https://www.googleapis.com/auth/calendar.addons.current.event.write 修改您在 Google 日历中打开的活动。
https://www.googleapis.com/auth/calendar.events.owned 在您拥有的 Google 日历上查看、创建、更改和删除活动。
https://www.googleapis.com/auth/calendar.events.owned.readonly 查看您拥有的 Google 日历上的活动。
https://www.googleapis.com/auth/calendar.events.freebusy 查看您有权访问的 Google 日历上的空闲状态信息。
https://www.googleapis.com/auth/calendar.app.created 创建 Google 辅助日历,以及在辅助日历上查看、创建、更改和删除活动。
https://www.googleapis.com/auth/calendar.calendarlist 查看、添加和移除您订阅的 Google 日历。
https://www.googleapis.com/auth/calendar.calendarlist.readonly 查看您订阅的 Google 日历的列表。
https://www.googleapis.com/auth/calendar.calendars 查看和更改您有权访问的 Google 日历的属性,以及创建辅助日历。
https://www.googleapis.com/auth/calendar.calendars.readonly 查看您有权访问的 Google 日历的标题、说明、默认时区和其他属性。
https://www.googleapis.com/auth/calendar.acls 查看和更改您拥有的 Google 日历的共享权限。
https://www.googleapis.com/auth/calendar.acls.readonly 查看您拥有的 Google 日历的共享权限。
https://www.googleapis.com/auth/calendar.events.public.readonly 查看公开日历上的活动。