Google 课堂插件现已面向开发者正式推出!如需了解详情,请参阅
插件文档。
Method: courses.create
创建课程。
ownerId
中指定的用户是所创建课程的所有者,且已添加为教师。非管理员申请用户只能创建以自己为所有者的课程。网域管理员可以创建归网域内任何用户所有的课程。
此方法会返回以下错误代码:
- 如果发出请求的用户无权创建课程或发生访问错误,则使用
PERMISSION_DENIED
。
- 如果主讲教师不是有效的用户,则为
NOT_FOUND
。
- 如果课程所有者的帐号已停用或由于出现以下请求错误,则使用
FAILED_PRECONDITION
:
- UserCannotOwnCourse
- UserGroupsMembershipLimitReached
- 如果
id
中指定了别名且已存在,则返回 ALREADY_EXISTS
。
HTTP 请求
POST https://classroom.googleapis.com/v1/courses
网址采用 gRPC 转码语法。
响应正文
如果成功,响应正文将包含一个新创建的 Course
实例。
授权范围
需要以下 OAuth 作用域:
https://www.googleapis.com/auth/classroom.courses
有关详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-04。
[null,null,["最后更新时间 (UTC):2024-09-04。"],[[["Creates a course with the specified owner and adds them as a teacher, with domain admins having broader creation privileges."],["Returns the newly created course details upon success but may yield errors related to permissions, user validity, or pre-existing data."],["Utilizes a POST request to `https://classroom.googleapis.com/v1/courses` with the course details provided in the request body."],["Requires the `https://www.googleapis.com/auth/classroom.courses` OAuth scope for authorization."]]],[]]