Skip to content

Latest commit

 

History

History
123 lines (93 loc) · 3.98 KB

File metadata and controls

123 lines (93 loc) · 3.98 KB
title Get resource
description Retrieve the binary data of a file or image resource object.
ms.localizationpriority medium
author jewan-microsoft
ms.subservice onenote
doc_type apiPageType
ms.date 06/22/2024

Get resource

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Retrieve the binary data of a file or image resource object.

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

HTTP request

GET /me/onenote/resources/{id}/content
GET /users/{id | userPrincipalName}/onenote/resources/{id}/content
GET /groups/{id}/onenote/resources/{id}/content
GET /sites/{id}/onenote/resources/{id}/content

Request headers

Name Type Description
Authorization string Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and the image or file binary data in the response body.

Note: Images don't render directly in a browser because they require authorization to retrieve them, like the rest of the page content.

Example

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/me/onenote/resources/{id}/content

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

HTTP/1.1 200 OK
Content-Type: application/octet-stream

...binary data...