Google 课堂插件现已面向开发者正式推出!如需了解详情,请参阅
插件文档。
管理课程邀请
Google 课堂中的 Invitation
资源表示邀请用户加入课程并获得特定课程角色:学生、教师或所有者。
每个 Invitation
资源都包含以下字段:
id
:Google 课堂为邀请分配的标识符。
userId
:受邀加入课程的用户的 ID。
courseId
:用户受邀加入的课程。
role
:受邀用户在课程中的课程角色。
创建邀请
invitations.create()
方法可用于邀请用户加入课程并授予其特定角色。在请求正文中添加 Invitation
资源,并指定 courseId
、userId
和 role
。
检索邀请
通过调用 invitations.get()
方法并指定邀请的 id
来检索特定邀请。
接受邀请
接受邀请后,系统会删除邀请,并将受邀用户添加到课程中,并为其分配邀请中指定的角色。通过调用 invitations.accept()
方法并指定邀请的 id
来接受邀请。
删除邀请
更新邀请的唯一方法是将其删除,然后创建新的邀请。如需删除邀请,请调用 invitations.delete()
方法并指定 id
。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-14。
[null,null,["最后更新时间 (UTC):2025-01-14。"],[[["An Invitation resource in Classroom allows users to join a course with a specific role, containing fields like `id`, `userId`, `courseId`, and `role`."],["You can create, retrieve, accept, and delete invitations using the Classroom API's `invitations` methods, specifying necessary parameters like `courseId`, `userId`, `role`, and `id`."],["Accepting an invitation adds the user to the course with the specified role and deletes the invitation, while deleting an invitation requires using the `invitations.delete()` method."],["Updating an invitation involves deleting the existing one and creating a new one with the desired changes."]]],[]]