Skip to content

Latest commit

 

History

History
93 lines (71 loc) · 2.25 KB

File metadata and controls

93 lines (71 loc) · 2.25 KB
title description ms.localizationpriority doc_type ms.subservice author
onenoteResource resource type
An image or other file resource on a OneNote page.
medium
resourcePageType
onenote
jewan-microsoft

onenoteResource resource type

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}/content

The file's resource URI is returned when you get a page's HTML content using the following request:

GET ../onenote/pages/{id}/content

In 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" ... />

Methods

Method Return Type Description
Get resource Stream Retrieve the binary data of a file or image resource.

Properties

Property Type Description
content Edm.Stream The content of the resource.
contentUrl String The URL for the content stream.

Relationships

None.