Questo metodo restituisce i seguenti codici di errore:
PERMISSION_DENIED se l'utente che effettua la richiesta non è autorizzato ad accedere al corso richiesto, a creare materiale didattico nel corso richiesto, a condividere un allegato di Drive o per errori di accesso.
INVALID_ARGUMENT se la richiesta è formattata in modo errato o se sono presenti più di 20
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-25 UTC."],[],[],null,["- [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 a course work material.\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 material 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 or if more than 20\n- materials are provided.\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\nHTTP request\n\n`POST https://classroom.googleapis.com/v1/courses/{courseId}/courseWorkMaterials`\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\nRequest body\n\nThe request body contains an instance of [CourseWorkMaterial](/workspace/classroom/reference/rest/v1/courses.courseWorkMaterials#CourseWorkMaterial).\n\nResponse body\n\nIf successful, the response body contains a newly created instance of [CourseWorkMaterial](/workspace/classroom/reference/rest/v1/courses.courseWorkMaterials#CourseWorkMaterial).\n\nAuthorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.courseworkmaterials`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]