Method: courses.courseWork.create
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יצירת מטלות.
עבודות הקורס שהתקבלו (וההגשות התלמידיות התואמות) משויכות לפרויקט במסוף הפיתוח של מזהה הלקוח ב-OAuth ששימש לשליחת הבקשה. כדי לשנות עבודות של תלמידים ולבצע שינויים בעבודות שהוגשו, צריך לשלוח בקשות ל-Classroom API באמצעות מזהה לקוח ב-OAuth מהפרויקט המשויך במסוף הפיתוח.
השיטה הזו מחזירה את קודי השגיאה הבאים:
PERMISSION_DENIED
אם למשתמש המבקש אין הרשאה לגשת לקורס המבוקש, ליצור עבודות בקורס המבוקש, לשתף קובץ מצורף ב-Drive או בגלל שגיאות גישה.
INVALID_ARGUMENT
אם הבקשה לא תקינה.
NOT_FOUND
אם הקורס המבוקש לא קיים.
FAILED_PRECONDITION
לשגיאת הבקשה הבאה:
בקשת HTTP
POST https://classroom.googleapis.com/v1/courses/{courseId}/courseWork
כתובת ה-URL משתמשת בתחביר של Transcoding של gRPC.
פרמטרים של נתיב
פרמטרים |
courseId |
string
המזהה של הקורס. המזהה הזה יכול להיות המזהה שהוקצה ב-Classroom או alias .
|
פרמטרים של שאילתה
פרמטרים |
previewVersion |
enum (PreviewVersion )
אופציונלי. גרסת התצוגה המקדימה של נקודת הקצה. צריך להגדיר את ההגדרה הזו כדי לגשת ליכולות API חדשות שזמינות למפתחים בתוכנית ה-Preview.
|
גוף הבקשה
גוף הבקשה מכיל מופע של CourseWork
.
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכיל מופע חדש של CourseWork
.
היקפי הרשאה
נדרש היקף הרשאות OAuth הבא:
https://www.googleapis.com/auth/classroom.coursework.students
מידע נוסף זמין במדריך ההרשאות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון 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.courseWork.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_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 course work.\n\nThe resulting course work (and corresponding student submissions) are associated with the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to make the request. Classroom API requests to modify course work and student submissions must be made with an OAuth client ID from the associated Developer Console project.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create course work in the requested course, share a Drive attachment, or for [access errors](/workspace/classroom/reference/Access.Errors).\n- `INVALID_ARGUMENT` if the request is malformed.\n- `NOT_FOUND` if the requested course does not exist.\n- `FAILED_PRECONDITION` for the following [request error](/workspace/classroom/reference/Request.Errors):\n - AttachmentNotVisible\n\n### HTTP request\n\n`POST https://classroom.googleapis.com/v1/courses/{courseId}/courseWork`\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. This identifier can be either the Classroom-assigned identifier or an [alias](/workspace/classroom/reference/rest/v1/courses.aliases#CourseAlias). |\n\n### Query parameters\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `previewVersion` | `enum (`[PreviewVersion](/workspace/classroom/reference/rest/v1/PreviewVersion)`)` Optional. The preview version of the endpoint. This must be set in order to access new API capabilities made available to developers in the Preview Program. |\n\n### Request body\n\nThe request body contains an instance of [CourseWork](/workspace/classroom/reference/rest/v1/courses.courseWork#CourseWork).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [CourseWork](/workspace/classroom/reference/rest/v1/courses.courseWork#CourseWork).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.coursework.students`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]