Google Classroom 外掛程式現已全面開放開發人員使用!詳情請參閱
外掛程式說明文件。
REST Resource: courses.aliases
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:CourseAlias
課程的替代 ID。
別名可用來唯一識別課程。在下列任一範圍內不得重複:
網域:網域層級別名可供別名建立者的網域內所有使用者查看,且只能由網域管理員建立。如果課程有 Classroom 以外的 ID,通常會使用網域層級別名。
專案:專案層級別名可供使用建立別名的開發人員控制台專案 ID 所建立的應用程式要求存取,任何專案皆可建立這類別名。應用程式有其他 ID 時,通常會使用專案範圍別名。您也可以使用隨機值,避免在傳輸失敗時重複課程,因為如果先前的傳輸成功,重試要求會傳回 ALREADY_EXISTS
。
JSON 表示法 |
{
"alias": string
} |
欄位 |
alias |
string
別名字串。字串的格式會指出所需別名的範圍。
d:<name> 表示網域層級別名。範例:d:math_101
p:<name> 表示專案範圍別名。範例:p:abc123
這個欄位的長度上限為 256 個半形字元。
|
方法 |
|
建立課程的別名。 |
|
刪除課程的別名。 |
|
傳回課程別名清單。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間: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. |"]]