本文包含 Google Classroom API 專屬的授權和驗證資訊。閱讀本文前,請務必先參閱「瞭解驗證和授權」,瞭解 Google Workspace 的一般驗證和授權資訊。
設定 OAuth 2.0 授權
設定 OAuth 同意畫面並選擇範圍,定義要向使用者和應用程式審查人員顯示的資訊,然後註冊應用程式,以便日後發布。
Classroom API 範圍
如要定義授予應用程式的存取層級,您需要識別並宣告授權範圍。授權範圍是 OAuth 2.0 URI 字串,其中包含 Google Workspace 應用程式名稱、存取資料類型和存取層級。「範圍」是指應用程式要求處理 Google Workspace 資料,包括使用者 Google 帳戶資料。
安裝應用程式時,系統會要求使用者驗證應用程式使用的範圍。一般來說,您應盡可能選擇範圍最窄的範圍,並避免要求應用程式不需要的範圍。使用者更願意授予存取權給範圍有限且說明清楚的應用程式。
Classroom API 支援下列範圍:
範圍 | 意義 |
---|---|
https://www.googleapis.com/auth/classroom.addons.teacher
|
查看、建立及更新要求 Google Cloud 專案在您任教的 Google Classroom 課程串流項目中的附件。 |
https://www.googleapis.com/auth/classroom.addons.student
|
查看及更新要求 Google Cloud 專案在 Google Classroom 串流項目中的附件。 |
https://www.googleapis.com/auth/classroom.announcements
|
在 Google Classroom 中查看及管理公告。 |
https://www.googleapis.com/auth/classroom.announcements.readonly
|
在 Google Classroom 中查看公告。 |
https://www.googleapis.com/auth/classroom.courses
|
查看、編輯、建立及永久刪除您的 Google Classroom 課程。 |
https://www.googleapis.com/auth/classroom.courses.readonly
|
查看您的 Google Classroom 課程。 |
https://www.googleapis.com/auth/classroom.coursework.me
|
查看、建立及編輯課堂作業項目,包括作業、問題和成績。 |
https://www.googleapis.com/auth/classroom.coursework.me.readonly
|
在 Google Classroom 中查看課程作業和成績。 |
https://www.googleapis.com/auth/classroom.coursework.students
|
管理您授課的 Google Classroom 課程中學生的課程作業和成績,以及查看您管理的課程中的課程作業和成績。 |
https://www.googleapis.com/auth/classroom.coursework.students.readonly
|
查看您授課或管理的 Google Classroom 課程中學生的課程作業和成績。 |
https://www.googleapis.com/auth/classroom.courseworkmaterials
|
在 Google Classroom 中查看、編輯和建立課程教材。 |
https://www.googleapis.com/auth/classroom.courseworkmaterials.readonly
|
查看您所有的 Google Classroom 課程教材。 |
https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly
|
查看您的 Google Classroom 監護人。 |
https://www.googleapis.com/auth/classroom.guardianlinks.students
|
查看及管理您的 Google Classroom 課程的學生監護人。 |
https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly
|
查看您的 Google Classroom 課程的學生監護人。 |
https://www.googleapis.com/auth/classroom.profile.emails
|
查看您課程中成員的電子郵件地址。 |
https://www.googleapis.com/auth/classroom.profile.photos
|
查看您課程中成員的個人資料相片。 |
https://www.googleapis.com/auth/classroom.push-notifications
|
接收有關您 Google Classroom 資料的通知。 |
https://www.googleapis.com/auth/classroom.rosters
|
管理 Google Classroom 課程學生名單。 |
https://www.googleapis.com/auth/classroom.rosters.readonly
|
查看您的 Google Classroom 課程學生名單。 |
https://www.googleapis.com/auth/classroom.student-submissions.me.readonly
|
在 Google Classroom 中查看課程作業和成績。 |
https://www.googleapis.com/auth/classroom.student-submissions.students.readonly
|
查看您授課或管理的 Google Classroom 課程中學生的課程作業和成績。 |
https://www.googleapis.com/auth/classroom.topics
|
在 Google Classroom 中查看、建立及編輯主題。 |
https://www.googleapis.com/auth/classroom.topics.readonly
|
在 Google Classroom 中查看主題。 |