Update educationModuleResource

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Update a resource in a module. Only teachers can perform this operation.

The only one property that can be updated is displayName, for all resource types.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) EduCurricula.ReadWrite Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application EduCurricula.ReadWrite.All Not available.

HTTP request

PATCH /education/classes/{class-id}/modules/{module-id}/resources/{resource-id}

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json

Request body

In the request body, supply the new value for the displayName field that will be updated.

Response

If successful, this method returns a 200 OK response code and an educationModuleResource object in the response body.

Examples

Request

The following example shows a request.

PATCH https://graph.microsoft.com/beta/education/classes/0b78e924-9623-49d8-b444-23bfabafa4fe/modules/fa1f6b67-7da6-458d-82fd-0d671df7bc31/resources/2fb5e262-611b-4672-8f55-1236b7f2804a
Content-type: application/json

{
    "resource": {
        "displayName" : "new pdf file patched.pdf"
    }
}

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 Ok
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#education/classes('0b78e924-9623-49d8-b444-23bfabafa4fe')/modules('fa1f6b67-7da6-458d-82fd-0d671df7bc31')/resources/$entity",
    "id": "2fb5e262-611b-4672-8f55-1236b7f2804a",
    "resource": {
        "@odata.type": "#microsoft.graph.educationFileResource",
        "displayName": "new pdf file patched.pdf",
        "createdDateTime": "2023-04-19T20:56:36.6529565Z",
        "lastModifiedDateTime": "2023-04-19T20:56:36.6529598Z",
        "fileUrl": "https://graph.microsoft.com/v1.0/drives/b!b8MR4rrk6kK793yj5m0azKvekbG46dBGsI2G7Vlzar_XjshebPh4RIbAjeFl67oU/items/01LGT6P7HL7I7CL2W3VNAYPD67G6SBIEB7",
        "createdBy": {
            "application": null,
            "device": null,
            "user": {
                "id": "93f30bbf-7f10-4dbb-a5bd-b59f75d4f690",
                "displayName": null
            }
        },
        "lastModifiedBy": {
            "application": null,
            "device": null,
            "user": {
                "id": "93f30bbf-7f10-4dbb-a5bd-b59f75d4f690",
                "displayName": null
            }
        }
    }
}