| title | onenoteResource resource type |
|---|---|
| description | An image or other file resource on a OneNote page. |
| ms.localizationpriority | medium |
| doc_type | resourcePageType |
| ms.subservice | onenote |
| author | jewan-microsoft |
| ms.date | 05/23/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
An image or other file resource on a OneNote page.
You can get the binary data of a resource, but getting a JSON representation of a resource object or a resource collection is not supported.
{
"content": "String (Stream)",
"contentUrl": "String"
}Get the binary data of a specific resource by sending a GET request to the resource's content endpoint:
GET ../onenote/resources/{id}/contentThe file's resource URI is returned when you get a page's HTML content using the following request:
GET ../onenote/pages/{id}/contentIn the page HTML, an img tag includes endpoints for the original image resource in the data-fullres-src attribute and the optimized image in the src attribute:
<img
src="image-resource-url"
data-src-type="media-type"
data-fullres-src="image-resource-url"
data-fullres-src-type="media-type" ... />An object tag (which represents files such as PDF, DOCX, and PNG) includes the endpoint for the file resource in the data attribute:
<object
data="file-resource-url"
data-attachment="file-name.file-type"
type="media-type" ... />| Method | Return Type | Description |
|---|---|---|
| Get resource | Stream | Retrieve the binary data of a file or image resource. |
| Property | Type | Description |
|---|---|---|
| content | Edm.Stream | The content of the resource. |
| contentUrl | String | The URL for the content stream. |
None.