Method: courses.create
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יוצר קורס.
המשתמש שצוין ב-ownerId
הוא הבעלים של הקורס שנוצר והוא נוסף כמורה. משתמש שאין לו הרשאת אדמין יכול ליצור קורס רק כשהוא הבעלים שלו. אדמינים בדומיין יכולים ליצור קורסים בבעלות של כל משתמש בדומיין שלהם.
השיטה הזו מחזירה את קודי השגיאה הבאים:
-
PERMISSION_DENIED
אם למשתמש ששולח את הבקשה אין הרשאה ליצור קורסים או אם יש שגיאות גישה.
-
NOT_FOUND
אם המורה הראשי הוא לא משתמש תקין.
-
FAILED_PRECONDITION
אם החשבון של בעל הקורס מושבת או אם מתקבלות שגיאות בבקשה הבאות:
- UserCannotOwnCourse
- UserGroupsMembershipLimitReached
- CourseTitleCannotContainUrl
ALREADY_EXISTS
אם צוין כינוי ב-id
והוא כבר קיים.
בקשת HTTP
POST https://classroom.googleapis.com/v1/courses
כתובת ה-URL משתמשת בתחביר של gRPC Transcoding.
גוף הבקשה
גוף הבקשה מכיל מופע של Course
.
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכיל מופע חדש של Course
.
היקפי הרשאה
נדרש היקף ההרשאות הבא של OAuth:
https://www.googleapis.com/auth/classroom.courses
מידע נוסף זמין במדריך ההרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-08 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-08 (שעון UTC)."],[],[],null,["# Method: courses.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a course.\n\nThe user specified in `ownerId` is the owner of the created course and added as a teacher. A non-admin requesting user can only create a course with themselves as the owner. Domain admins can create courses owned by any user within their domain.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for [access errors](/workspace/classroom/reference/Access.Errors).\n- `NOT_FOUND` if the primary teacher is not a valid user.\n- `FAILED_PRECONDITION` if the course owner's account is disabled or for the following [request errors](/workspace/classroom/reference/Request.Errors):\n - UserCannotOwnCourse\n - UserGroupsMembershipLimitReached\n - CourseTitleCannotContainUrl\n- `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.\n\n### HTTP request\n\n`POST https://classroom.googleapis.com/v1/courses`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains an instance of [Course](/workspace/classroom/reference/rest/v1/courses#Course).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Course](/workspace/classroom/reference/rest/v1/courses#Course).\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)."]]