Ändert Anhänge von abgegebenen Aufgaben von Schülern/Studenten.
Anhänge können nur zu Einreichungen von Schülern/Studenten hinzugefügt werden, die zu Kursarbeitsobjekten mit einer workType von ASSIGNMENT gehören.
Diese Anfrage muss über das Developer Console-Projekt der OAuth-Client-ID erfolgen, die zum Erstellen des entsprechenden Kurselements verwendet wurde.
Diese Methode gibt die folgenden Fehlercodes zurück:
PERMISSION_DENIED, wenn der anfragende Nutzer nicht auf den angeforderten Kurs oder die angeforderte Kursarbeit zugreifen darf, wenn der Nutzer keine Anhänge in der angeforderten Einreichung des Schülers oder Studenten ändern darf oder bei Zugriffsfehlern.
INVALID_ARGUMENT, wenn die Anfrage fehlerhaft ist.
NOT_FOUND, wenn der angeforderte Kurs, die angeforderte Kursarbeit oder die angeforderte Einreichung eines Schülers oder Studenten nicht vorhanden ist.
HTTP-Anfrage
POST https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments
Optional. Die Vorabversion der API. Diese Einstellung muss festgelegt sein, um auf neue API-Funktionen zugreifen zu können, die Entwicklern im Vorabprogramm zur Verfügung gestellt werden.
Antworttext
Wenn der Vorgang erfolgreich abgeschlossen wurde, enthält der Antworttext eine Instanz von StudentSubmission.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-25 (UTC)."],[],[],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nModifies attachments of student submission.\n\nAttachments may only be added to student submissions belonging to course work objects with a `workType` of `ASSIGNMENT`.\n\nThis request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, if the user is not permitted to modify attachments on the requested student submission, or for [access errors](/workspace/classroom/reference/Access.Errors).\n- `INVALID_ARGUMENT` if the request is malformed.\n- `NOT_FOUND` if the requested course, course work, or student submission does not exist.\n\nHTTP request\n\n`POST https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath 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| `courseWorkId` | `string` Identifier of the course work. |\n| `id` | `string` Identifier of the student submission. |\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"addAttachments\": [ { object (/workspace/classroom/reference/rest/v1/courses.courseWork.studentSubmissions#Attachment) } ], \"previewVersion\": enum (/workspace/classroom/reference/rest/v1/PreviewVersion) } ``` |\n\n| Fields ||\n|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `addAttachments[]` | `object (`[Attachment](/workspace/classroom/reference/rest/v1/courses.courseWork.studentSubmissions#Attachment)`)` Attachments to add. A student submission may not have more than 20 attachments. [Form](/workspace/classroom/reference/rest/v1/Form) attachments are not supported. |\n| `previewVersion` | `enum (`[PreviewVersion](/workspace/classroom/reference/rest/v1/PreviewVersion)`)` Optional. The preview version of the API. This must be set in order to access new API capabilities made available to developers in the Preview Program. |\n\nResponse body\n\nIf successful, the response body contains an instance of [StudentSubmission](/workspace/classroom/reference/rest/v1/courses.courseWork.studentSubmissions#StudentSubmission).\n\nAuthorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/classroom.coursework.students`\n- `\n https://www.googleapis.com/auth/classroom.coursework.me`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]