Method: courses.aliases.create
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יצירת כינוי לקובץ קורס.
השיטה הזו מחזירה את קודי השגיאה הבאים:
PERMISSION_DENIED
אם למשתמש המבקש אין הרשאה ליצור את כתובת האימייל החלופית, או בגלל שגיאות גישה.
NOT_FOUND
אם הקורס לא קיים.
ALREADY_EXISTS
אם כתובת האימייל החלופית כבר קיימת.
FAILED_PRECONDITION
אם הכינוי החלופי המבוקש לא הגיוני למשתמש או לקורס שמבקשים אותו (לדוגמה, אם משתמש שלא נמצא בדומיין מנסה לגשת לכתובת אימייל חלופית ברמת הדומיין).
בקשת HTTP
POST https://classroom.googleapis.com/v1/courses/{courseId}/aliases
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של נתיב
פרמטרים |
courseId |
string
המזהה של הקורס שרוצים ליצור לו כינוי. המזהה הזה יכול להיות המזהה שהוקצה ב-Classroom או alias .
|
גוף הבקשה
גוף הבקשה מכיל מופע של CourseAlias
.
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכיל מופע חדש של CourseAlias
.
היקפי הרשאה
נדרש היקף הרשאות OAuth הבא:
https://www.googleapis.com/auth/classroom.courses
מידע נוסף זמין במדריך ההרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],[],null,["# Method: courses.aliases.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates an alias for a course.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for [access errors](/workspace/classroom/reference/Access.Errors).\n- `NOT_FOUND` if the course does not exist.\n- `ALREADY_EXISTS` if the alias already exists.\n- `FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or course (for example, if a user not in a domain attempts to access a domain-scoped alias).\n\n### HTTP request\n\n`POST https://classroom.googleapis.com/v1/courses/{courseId}/aliases`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `courseId` | `string` Identifier of the course to alias. This identifier can be either the Classroom-assigned identifier or an [alias](/workspace/classroom/reference/rest/v1/courses.aliases#CourseAlias). |\n\n### Request body\n\nThe request body contains an instance of [CourseAlias](/workspace/classroom/reference/rest/v1/courses.aliases#CourseAlias).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [CourseAlias](/workspace/classroom/reference/rest/v1/courses.aliases#CourseAlias).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.courses`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]