選擇 Google Calendar API 範圍

本文包含 Google 日曆 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 您可透過日曆查看及下載任何您能存取的日曆。
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 查看 Google 日曆設定。
https://www.googleapis.com/auth/calendar.addons.execute 做為 Google 日曆外掛程式使用。
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 查看公開日曆上的活動。