Google Classroom 外掛程式現已全面開放開發人員使用!詳情請參閱
外掛程式說明文件。
REST Resource: invitations
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:Invitation
JSON 表示法 |
{
"id": string,
"userId": string,
"courseId": string,
"role": enum (CourseRole )
} |
欄位 |
id |
string
Classroom 指派的 ID。 唯讀。
|
userId |
string
受邀使用者的 ID。 當此 ID 指定為要求的參數時,可以設為下列其中一個:
- 使用者的數字 ID
- 使用者的電子郵件地址
- 字串常值
"me" ,表示要求使用者
|
courseId |
string
邀請使用者加入的課程 ID。
|
role |
enum (CourseRole )
邀請使用者擁有的角色。不得為 COURSE_ROLE_UNSPECIFIED 。
|
CourseRole
列舉 |
COURSE_ROLE_UNSPECIFIED |
沒有課程角色。 |
STUDENT |
課程學生。 |
TEACHER |
課程老師。 |
OWNER |
課程擁有者。 |
方法 |
|
接受邀請、移除邀請,並將受邀使用者加入指定課程的學生或老師 (視情況而定)。 |
|
建立邀請。 |
|
刪除邀請。 |
|
傳回邀請。 |
|
傳回要求使用者可查看的邀請清單,僅限於符合清單要求的邀請。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# REST Resource: invitations\n\n- [Resource: Invitation](#Invitation)\n - [JSON representation](#Invitation.SCHEMA_REPRESENTATION)\n- [CourseRole](#CourseRole)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Invitation\n--------------------\n\nAn invitation to join a course.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"id\": string, \"userId\": string, \"courseId\": string, \"role\": enum (/workspace/classroom/reference/rest/v1/invitations#CourseRole) } ``` |\n\n| Fields ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | `string` Identifier assigned by Classroom. Read-only. |\n| `userId` | `string` Identifier of the invited user. When specified as a parameter of a request, this identifier can be set to one of the following: - the numeric identifier for the user - the email address of the user - the string literal `\"me\"`, indicating the requesting user |\n| `courseId` | `string` Identifier of the course to invite the user to. |\n| `role` | `enum (`[CourseRole](/workspace/classroom/reference/rest/v1/invitations#CourseRole)`)` Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`. |\n\nCourseRole\n----------\n\nPossible roles a user may be invite to have.\n\n| Enums ||\n|---------------------------|------------------------|\n| `COURSE_ROLE_UNSPECIFIED` | No course role. |\n| `STUDENT` | Student in the course. |\n| `TEACHER` | Teacher of the course. |\n| `OWNER` | Owner of the course. |\n\n| Methods ------- ||\n|-------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| ### [accept](/workspace/classroom/reference/rest/v1/invitations/accept) | Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. |\n| ### [create](/workspace/classroom/reference/rest/v1/invitations/create) | Creates an invitation. |\n| ### [delete](/workspace/classroom/reference/rest/v1/invitations/delete) | Deletes an invitation. |\n| ### [get](/workspace/classroom/reference/rest/v1/invitations/get) | Returns an invitation. |\n| ### [list](/workspace/classroom/reference/rest/v1/invitations/list) | Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. |"]]