Google 课堂插件现已面向开发者正式推出!如需了解详情,请参阅
插件文档。
REST Resource: invitations
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
资源:邀请
JSON 表示法 |
{
"id": string,
"userId": string,
"courseId": string,
"role": enum (CourseRole )
} |
字段 |
id |
string
Google 课堂分配的标识符。 只读。
|
userId |
string
受邀用户的标识符。 将此标识符指定为请求的参数时,可以将其设置为以下某个值:
- 用户的数字标识符
- 用户的电子邮件地址
- 字符串字面量
"me" ,表示请求用户
|
courseId |
string
要邀请用户加入的课程的标识符。
|
role |
enum (CourseRole )
邀请用户拥有的角色。不得为 COURSE_ROLE_UNSPECIFIED 。
|
CourseRole
枚举 |
COURSE_ROLE_UNSPECIFIED |
无课程角色。 |
STUDENT |
课程学员。 |
TEACHER |
课程教师。 |
OWNER |
课程的所有者。 |
方法 |
|
接受邀请、移除邀请,并将受邀用户添加为指定课程的教师或学生(视情况而定)。 |
|
创建邀请。 |
|
删除邀请。 |
|
返回邀请。 |
|
返回请求用户有权查看的邀请列表,仅限与列表请求匹配的邀请。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):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. |"]]