Google 课堂插件现已面向开发者正式推出!如需了解详情,请参阅
插件文档。
REST Resource: courses.aliases
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
资源:CourseAlias
课程的备用标识符。
别名用于唯一标识课程。在以下任一范围内,此 ID 都必须是唯一的:
网域:网域级别名对别名创建者的网域中的所有用户可见,并且只能由网域管理员创建。当课程具有 Google 课堂之外的标识符时,通常会使用网域级别的别名。
项目:项目级别别名对使用创建别名的 Google Developers Console 项目 ID 的应用发出的任何请求都是可见的,并且可以由任何项目创建。当应用具有备用标识符时,通常会使用项目级别的别名。随机值还可用于避免在传输失败时出现重复课程,因为如果之前的请求成功,重试请求将返回 ALREADY_EXISTS
。
JSON 表示法 |
{
"alias": string
} |
字段 |
alias |
string
别名字符串。字符串的格式表示所需的别名作用域。
d:<name> 表示网域级别名。示例:d:math_101
p:<name> 表示项目级别别名。示例:p:abc123
此字段的最大长度为 256 个字符。
|
方法 |
|
为课程创建别名。 |
|
删除课程的别名。 |
|
返回课程的别名列表。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# REST Resource: courses.aliases\n\n- [Resource: CourseAlias](#CourseAlias)\n - [JSON representation](#CourseAlias.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: CourseAlias\n---------------------\n\nAlternative identifier for a course.\n\nAn alias uniquely identifies a course. It must be unique within one of the following scopes:\n\n- domain: A domain-scoped alias is visible to all users within the alias creator's domain and can be created only by a domain admin. A domain-scoped alias is often used when a course has an identifier external to Classroom.\n\n- project: A project-scoped alias is visible to any request from an application using the Developer Console project ID that created the alias and can be created by any project. A project-scoped alias is often used when an application has alternative identifiers. A random value can also be used to avoid duplicate courses in the event of transmission failures, as retrying a request will return `ALREADY_EXISTS` if a previous one has succeeded.\n\n| JSON representation |\n|-----------------------------|\n| ``` { \"alias\": string } ``` |\n\n| Fields ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `alias` | `string` Alias string. The format of the string indicates the desired alias scoping. - `d:\u003cname\u003e` indicates a domain-scoped alias. Example: `d:math_101` - `p:\u003cname\u003e` indicates a project-scoped alias. Example: `p:abc123` This field has a maximum length of 256 characters. |\n\n| Methods ------- ||\n|-----------------------------------------------------------------------------|-----------------------------------------|\n| ### [create](/workspace/classroom/reference/rest/v1/courses.aliases/create) | Creates an alias for a course. |\n| ### [delete](/workspace/classroom/reference/rest/v1/courses.aliases/delete) | Deletes an alias of a course. |\n| ### [list](/workspace/classroom/reference/rest/v1/courses.aliases/list) | Returns a list of aliases for a course. |"]]