OneNote API API Reference

We encourage developers to migrate to Microsoft Graph API, which exposes the OneNote API operations through a common endpoint and supports unified authentication. Learn more about developing with Microsoft Graph.

Note: The service URIs are updated to use the new pattern .../api/{version}/me/notes. Moving forward, you should use this pattern in your requests.

  • Find our latest code examples on GitHub

The Microsoft OneNote API enables developers to create innovative, multi-platform apps that use OneNote and help people organize their lives.

Subscribe to the OneNote page on API Changelog and stay up-to-date with changes to our API and documentation.

The OneNote API runs on the Microsoft globally-available cloud, and sends data from your apps into the user's OneNote notebooks. When saving page data, it also does things like run OCR on images, rendering Web pages as snapshot-images, and more.

The API works with the following OneNote resources:

  • Pages
  • Sections
  • SectionGroups
  • Notebooks

It also allows you to work with resources at various points in the OneNote hierarchy, such as sections and section groups nested in section groups. The API supports a growing number of read and write operations on these resources.

When retrieving OneNote notebooks, sections, and section groups, you can also control what's returned by using OData query options such as filter, orderby, and select.

The OneNote API sends and receives metadata for pages, sections, section groups, and notebooks in the form of JSON objects that conform to the OData version 4.0 specification.

Page content is represented by a subset of HTML tags that are described in the following section.

HTML tag support for pages

The OneNote API accepts a limited set of HTML tags to define page structure. The tags you can use are those that can be mapped to the features available on OneNote pages, and are described here.

Input HTML that defines the OneNote page structure and structure has the following requirements:

  • The HTML must be UTF-8 encoded.
  • The HTML should be well-formed XML for reliability. All tags with content require matching closing tags.
  • All attribute values must be surrounded by double- or single-quote marks.

When your app sends HTML to the OneNote API in an HTTP request, be aware of the following general limitations:

  • JavaScript code, included files and CSS are removed.
  • HTML forms are removed in their entirety.

In addition to input HTML, you can also pass HTML to the page-rendering feature via the <img data-render-src="..."> tag. When you use the page-rendering feature, the set of supported HTML tags is closer to a standards-compliant browser, and the resulting web page is inserted into the OneNote page as a bitmapped image. This topic describes the tags recognized by the API in a page POST, and the markup for images, embedded file data, and rendered HTML blocks.

Supported HTML tags and limitations

Tag Limitations
<html> Appropriate to enclose the content, but not required unless specifying a title.
<head> Supported, but not required unless specifying a title.
<title> The contents of this tag will be used as the page title, if it exists.
<meta> This tag is generally ignored by the API, except when the name attribute is "created". See the meta tag details section.
<body> Supported, but not required.
<div>, <span> Supported, but not required.
<a> Contents of the tag can only be text at this time. Images cannot be linked.
<p>, <br/> See important information about the <p> tag in the p tag details section.
<h1>...<h6> Mapped to the corresponding OneNote heading styles.
<ul>, <ol>, <li> Unordered and ordered lists are supported, including nested lists. Type attribute is ignored.
<img> See important information about this tag in the img tag details section.
<object> Allowed for embedding file objects. See the object tag details section. Otherwise ignored.
<table>, <tr>, <td> Mapped to OneNote tables. Nested tables are allowed. Supports the border attribute with single value (border="2"). <table> and <td> accept width as either number of pixels (width="100px") or percent of page width (width="60%").
<pre> Preformatted text (preserves white space and line breaks).
<b>, <em>, <strong>, <i>, <u>, <strike>, <del>, <sup>, <sub>, <cite>, <font> Mapped to the available character styles in OneNote. The <font> tag only accepts the face and color attributes.

meta tag details

The following code shows how to use the meta tag in a simple POST.

 Content-Type:multipart/form-data; boundary=BlockPartBoundary [NL] --BlockPartBoundary [NL] Content-Disposition:form-data;name="Presentation" [NL] Content-Type:application/xhtml+xml [NL] <?xml version="1.0"> [NL] <html> [NL][T] <head> [NL][T][T] <title>Example showing how to set the creation [NL][T][T] data-time</title> [NL][T][T] <meta name="created" content="2013-06-11T06:30:00-08:00"/> [NL][T] </head> [NL][T] <body> [NL][T][T] <p>The head tag sets the created data and time of the [NL][T][T] capture.</p> [NL][T] </body> [NL] </html> [NL] --BlockPartBoundary--

The OneNote API recognizes a <meta> tag only when it sets the created date and time of a new OneNote page. If the <meta> tag is not present, the page created time will be blank. The <meta> tag must include name="created" and the content attribute. The content value should be either (a) an ISO 8601 standard time stamp with a UTC timezone offset or (b) a timezone offset without date and time. The latter sets the page creation to the time in that timezone when the page was created. The following code shows this usage.

<meta name="created" content="-08:00" />

p tag details

With modern CSS implemented in browsers, the <p> tag can have a wide variety of style attributes. Many are supported for <p> tags in the input HTML used to create a new OneNote page. For example:

  • background-color:#HEXCODE will highlight the text. Both hexadecimal #RRGGBB format and named colors (for example, red) are accepted.
  • color:#HEXCODE gives the color for the text. Both hexadecimal #RRGGBB format and named colors (for example, red) are accepted.
  • font-family:fontName1, fontName2 indicates the font to use. The font names must be available on the device, and OneNote only uses the first name in the list.
  • font-size:XXpx specifies the font character size, in pixels. Point-size (for example, 12pt) and other ways of specifying font sizing are not recognized.

The following code shows a paragraph tag using the supported style attributes.

 <p style="color:#00FFFF; font-family:Garamond; font-size:28px; [NL] background-color:#000000"\>This paragraph shows yellow, [NL] 28-pixel Garamond text on a black background</p> 

img tag details

Use the <img> tag to include images in your capture. There are three ways to include images: (a) by referencing internet images as you would in a standard HTML page, (b) by including the image directly in the POST request, and (c) by embedding an image of a web page.

Image attributes

The OneNote API supports the following attributes in <img> tags:

  • src="http://..." is the normal HTML way of indicating the image source, which will be included in the OneNote page if it is publicly accessible on the internet.
  • src="name:BlockName" indicates the MIME part name in the POST that includes the binary image data to be used for this image in the OneNote page.
  • data-render-src="http://..." is an attribute recognized by the OneNote API. When given a URL, the page-rendering service inserts a bit-mapped image of the web page as it would appear in a web browser, into the new OneNote page.
  • data-render-src="name:BlockName" is an attribute recognized by the OneNote API. When the attribute value is of the name:... form, it indicates the MIME part name in the POST that includes and HTML to render as an image. The resulting bit-mapped image is inserted into the new OneNote page. When the part is a PDF file (content-type:application/pdf), each page will be rendered as a separate image on the page.
  • alt is the alternative text used by screen-readers and if the image can't be rendered.
  • height is the height, in pixels, that the image will be inserted into the OneNote page. The unit is always pixels. When the image comes from a multi-page PDF file, the height specifies the total height for all the pages together. To specify the size of each image, multiply the desired height by the number of pages in the PDF file.
  • width is the width, in pixels, that the image will be inserted into the OneNote page.
  • style can be used to set maximum values for width and height: style="max-width:150px; max-height:200px

Limits when using images

Remember these limits when you're embedding images in a OneNote API capture. We're working to remove or expand these limits, but for now they are:

  • Total POST size limit is ~70 MB, including file and other data. Captures with data more than that limit may make your app and captures unreliable, so be careful.
  • MIME part size limit is 25 MB. Larger data blocks will be rejected by the API. This applies to both images and file-data parts, and the size include the part headers.
  • Image limit is 150 per page. When using the src="internetURL" attribute, the API ignores <img> tags beyond the limit.
  • MIME parts limit is 6 per POST. That includes the Presentation HTML part.
  • **Maximum number of <img/> and <object/> tags using data-render-src is 5 (images) or 1 (object). That is, you can have up to five images but only one PDF document displayed via an <img data-render-src="name:blockName"> tag. Additional rendered images and embedded files are ignored.
  • File-type icons are predefined. The OneNote API recognizes a wide variety of common file types, and embeds the file using predefined icons. If the API doesn't recognize the file type, it uses a generic file icon.

Referencing an image by URL

When your capture HTML includes a standard <img src="..."/> tag, the src attribute gives the normal URL of the image. The OneNote API gets a copy of that image from the internet, and inserts it directly into the page. If the img tag includes height or width attributes (always in pixels), those values are used to size the image on the new OneNote page. The following code shows an example.

 <img src="http://officeimg.vo.msecnd.net/en-us/files/018/949/ZA103278226.png" height="180" width="345"/>

If you reference images by URL, ensure they are available to the OneNote on the public internet. If you provide a URL to an image that the API can't get, it won't show up on the captured page.

Including image data in the POST

You can also send the image data for up to 30 images directly inside the OneNote API POST. This is common when the images are from a mobile device camera, or if your app is running on a hardware device like a scanner or camera. Even if the image is also available on the Internet, embedding the data in your POST can sometimes make the captured page available to OneNote user sooner, by reducing the total number of round-trips needed to build the OneNote page.

To embed an image into your POST, you use the src attribute with a value of "name:BlockName". The name prefix tells the OneNote API that the rest of the attribute value is the name of a MIME part in the POST.

The following is an example of an embedded image (HTTP headers and code not involved with the image have been removed).

 Content-Type:multipart/form-data; boundary=NewPart12345 [NL] --NewPart12345 [NL] Content-Disposition:form-data; name="Presentation" [NL] Content-Type:text/html [NL] <!DOCTYPE html> [NL] <html> [NL][T] <body> [NL][T][T] <img src="name:imageDataPart1" width="50" height="50"/> [NL][T] </body> [NL] </html> [NL] --NewPart12345 [NL] Content-Disposition:form-data; name="imageDataPart1" [NL] Content-Type:image/jpeg [NL] ...binary image data... [NL][NL] --NewPart12345--

It's important to note that you don't need to Base64 or otherwise encode the binary image data. That saves time and bytes over-the-wire for both your app and the OneNote API. Also, remember that the OneNote API only uses the first 30 image data blocks included in the POST.

Capturing a web page as an image

You can have the OneNote API include a screen-shot of a Web page as an image inside your captured page. The web page can either be a publicly-available Internet web page you reference by URL, or you can provide the HTML in a MIME part. This is useful when the user wants to capture a web page they're viewing, like when they're doing research for a on-sale purchase, or want a record of what a page looked like at that moment.

When capturing web pages this way, the height and width attributes tell the OneNote API how large to display the image inside the captured OneNote page. This isn't necessarily the same as the actual page. If you want the image of the web page to appear in OneNote at the original size, don't include height and width attributes in the img tag.

To have OneNote render the page as an image, you include the data-render-src attribute in an img tag. When a browser displays the img tag, the data-render-src attribute has no meaning for it, so instead the browser uses the normal src attribute. When you post that img tag to the OneNote API, it uses the information in the data-render-src attribute to decide how to create a screen-shot of the information.

There are two ways to use the data-render-src attribute. If the value is like:

  • data-render-src="http://www.onenote.com" then the API generates a JPEG preview of the web page, and inserts that into the captured page.
  • data-render-src="name:imageDataPartName" then the API takes the HTML from the POST data part that has the indicated imageDataPartName value, generates a JPEG preview of the HTML, and inserts that JPEG image into the page.

The following is an example that shows both ways of including a rendered image of a web page.

 Content-Type:multipart/form-data; boundary=NewPart12345 [NL] --NewPart12345 [NL] Content-Disposition:form-data; name="Presentation" [NL] Content-Type:text/html [NL] <!DOCTYPE html> [NL] <html> [NL][T] <body> [NL][T][T] <p>This first image embeds a screen-shot of the [NL][T][T] onenote.com web site.</p> [NL][T][T] <img data-render-src="http://www.onenote.com" width="500"/> [NL][T][T] <p>This second image embeds a bit of HTML in the next [NL][T][T] multi-part block as a screen-shot</p> [NL][T][T] <img data-render-src="name:htmlPart" width="500"/> [NL][T] </body> [NL] </html> [NL] --NewPart12345 [NL] Content-Disposition:form-data; name="htmlPart" [NL] Content-Type:text/HTML [NL] <html> [NL][T] <body> [NL][T][T] <h1>This will be rendered in an image<h1> [NL][T][T] <p style="font-weight:bold">and so will this text. Don't [NL][T][T] try to embed another data-render-src type image inside [NL][T][T] the HTML part; it won't work. Instead, use URL-based [NL][T][T] real images like this:</p> [NL][T][T] <img src="http://officeimg.vo.msecnd.net/en-us/files/ [NL][T][T] 018/949/ZA103278226.png" height="180" width="345"/> [NL][T] </body> [NL] </html> [NL] --NewPart12345--

The HTML you provide in a separate MIME part for rendering is not limited to the set of tags listed in this topic. The rendering engine is much closer to a standard web browser, with some limitations around browser plug-ins and active content. If you have complex layout you really want displayed on the captured page, including that complex HTML as an image might be a good option.

The web page rendering doesn't recognize the data-render-src attribute, so you can't include them inside the HTML part.

Tip

The page-rendering has no ability to log-in for the user, so pages that require being logged in will likely not turn out as your users expect, if you use send just the URL in the data-render-src attribute. For example, if someone is looking at their purchase history or account status, and they try to capture the page. If your app includes an img tag with the data-render-src attribute set to the current URL, the thumbnail will usually be either the site login-page, or worse, an "access denied" page. In those cases, it's best to grab the page's HTML and send that in a named part of your POST. However, be aware that there are some risks with that, especially if the HTML contains images that can only be retrieved by a logged in user.

Content Extraction from URLs and Images

The OneNote API can recognise when a webpage contains a product or recipe and extract and format the most relevant information into a format optimised for viewing in OneNote.

This is accomplished using a div tag and the data-render-method attribute:

<div 
data-render-method="extract" 
data-render-src="{URL | NamedPart}"
data-render-fallback="none">
</div> 

Fallback Behaviour

Fallback behaviour is configurable via the data-render-fallback attribute for cases in which the OneNote API is unable to extract content from the provided source.

There are two values:

  • none: If extraction fails nothing will be added to the resulting page.
  • render: An image of the source content is inserted into the page as if you had used <img data-render-src="..."/>

If data-render-fallback is not provided it defaults to render.

For scenarios where you use the none fallback it is recommended you include a link or other way for the user to view the original content should extraction fail.

object tag details

Use the object tag to embed files directly on the OneNote page, displaying them as an icon representing the file type, and not showing the actual file contents, as happens with the img tag. The data referenced by the object tag must be provided in a MIME part of the POST request, and cannot be a URL reference.

Object attributes

The object tag is used in different ways by different browser plug-ins, and has an open standard definition. The OneNote API takes advantage of that flexibility and supports the following attributes in object tags:

  • data-attachment="DisplayedFileName.extension" specifies the file name and extension displayed on the OneNote page for the file. That value will also be used if the user saves the file by activating it from the OneNote page.
  • data="name:PartName" indicates the MIME part name in the POST that includes the file data to be embedded in the OneNote page. Embedded files can only be added to a page by sending the data directly in the multi-part POST request.
  • type="standardMIMEtype" tells the OneNote API what type of file is being embedded. Be sure that the MIME type you specify is the same type as the file data, or the OneNote API could return an error for the POST request.

The icon displayed in the OneNote page for the embedded file is determined in the following precedence:

  1. Filename extension provided in the data-attachment attribute. If that isn't recognized, then‚

  2. Type attribute is checked for a recognized MIME type. If that isn't recognized, then‚

  3. Content-Type header of the file data MIME part is checked. If that isn't recognized, then‚

  4. The default "document" icon is used.

Remember these limits when you're embedding files in a OneNote API capture. We're working to remove or expand these limits, but for now they are:

  • Total POST size limit is ~70 MB, including file and other data. Captures with data more than that limit may make your app and captures unreliable, so be careful.
  • MIME part size limit is 25 MB. Larger data blocks will be rejected by the API. This applies to both images and file-data parts, and the size include the part headers.
  • MIME parts limit is 6 per POST. That includes the Presentation HTML part.
  • Maximum number of <img/> and <object/> tags using data-render-src is 5. Additional rendered images and embedded files are ignored.
  • File-type icons are predefined. The OneNote API recognizes a wide variety of common file types, and embeds the file using predefined icons. If the API doesn't recognize the file type, it uses a generic file icon.

The following code shows how to embed a file using REST.

 Content-Type:multipart/form-data; boundary=MyAppPartBoundary [NL] Authorization:bearer tokenString [NL] --MyAppPartBoundary [NL] Content-Disposition:form-data; name="Presentation" [NL] Content-type:text/html
API Endpoint
https://www.onenote.com/api/
Schemes: https

Authentication

Bearer Auth

description

Bearer tokenString A valid OAuth token provided to the app based on the user credentials and the user having authorized access. For more information, see OneNote authentication and permissions.

GET Notebooks

When you use the GET verb with the /notebooks endpoint, the OneNote API returns the notebooks as JSON objects that conform to the OData version 4.0 specification.

GET /v1.0/me/notes/notebooks

Production Gets all notebooks to which a user has access in Microsoft OneDrive. This includes notebooks that are both owned by and shared with the user.

filter

A Boolean expression for whether to include an entry in the result set. Property names and OData string comparisons are case sensitive.

type
string
in
query
orderby

One or more comma-delimited expressions, with asc (default) or desc sort order, in the order you want the sort applied. Property names are case sensitive. The default is name asc.

type
string
in
query
select

One or more comma-delimited properties to return for each entry in the response. Property names are case sensitive. The default response returns all properties.c

type
string
in
query
expand

One or more comma-delimited navigation properties to return inline in the response. Property names are case sensitive. Valid values for notebooks are sections andsectionGroups`.

type
string
in
query
top

The number of entries to return in the result set.

type
number
in
query
skip

The number of entries to skip in the result set.

type
number
in
query
count

The count of entities in the collection. The value is returned in the odata.count property in the response.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "odata.context": "https://www.onenote.com/api/v1.0/$metadata#me/notes/notebooks",
  "value": [
	{
	  "createdBy": "user name",
	  "createdTime": "2013-10-05T10:57:00.683Z",
	  "id": "notebook ID",
	  "isDefault": false,
	  "isShared": false,
	  "lastModifiedBy": "user name",
	  "lastModifiedTime": "2014-01-28T18:49:00.47Z",
	  "links": {
		"oneNoteClientUrl": {
		  "href": "onenote:https://{client URL}"
		},
		"oneNoteWebUrl": {
		  "href": "https://{web URL}"
		}
	  },
	  "name": "notebook name",
	  "sectionGroupsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sectionGroups",
	  "sectionsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sections",
	  "self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}",
	  "userRole": "Contributor"
	}
  ]
}

GET /v1.0/me/notes/notebooks/{id}

Production Gets a specific notebook.

id

The id of the notebook.

type
string
in
path
filter

A Boolean expression for whether to include an entry in the result set. Property names and OData string comparisons are case sensitive.

type
string
in
query
orderby

One or more comma-delimited expressions, with asc (default) or desc sort order, in the order you want the sort applied. Property names are case sensitive. The default is name asc.

type
string
in
query
select

One or more comma-delimited properties to return for each entry in the response. Property names are case sensitive. The default response returns all properties.c

type
string
in
query
expand

One or more comma-delimited navigation properties to return inline in the response. Property names are case sensitive. Valid values for notebooks are sections andsectionGroups`.

type
string
in
query
top

The number of entries to return in the result set.

type
number
in
query
skip

The number of entries to skip in the result set.

type
number
in
query
count

The count of entities in the collection. The value is returned in the odata.count property in the response.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "createdBy": "user name",
  "createdTime": "2013-10-05T10:57:00.683Z",
  "id": "notebook ID",
  "isDefault": false,
  "isShared": false,
  "lastModifiedBy": "user name",
  "lastModifiedTime": "2014-01-28T18:49:00.47Z",
  "links": {
	"oneNoteClientUrl": {
	  "href": "onenote:https://{client URL}"
	},
	"oneNoteWebUrl": {
	  "href": "https://{web URL}"
	}
  },
  "name": "notebook name",
  "sectionGroupsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sectionGroups",
  "sectionsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sections",
  "self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}",
  "userRole": "Contributor"
}

PATCH Pages

You can use PATCH requests to update page content or to change the indentation level of a page (Beta).

Updating page content

Every PATCH ../page/{id}/content request is comprised of an array of JSON objects that use the following attributes to define changes:

  • target
  • action
  • position
  • content

target

The element to update. The value must be one of the following identifiers:

  • data-id of the element, prefixed with a #. This ID is optionally defined in the input HTML when creating or updating a page.
  • id of the element, not prefixed with a #. This ID is generated by the OneNote API and returned when the GET request for page content uses ?includeIDs=true.
  • body keyword, not prefixed with a #. This targets the first div on the page.
  • title keyword, not prefixed with a #.

Although data-id and id are interchangeable for append, prepend, and insert actions, most replace actions require using the id.

To get the IDs on a page, send a GET request to the page's content endpoint:

  • GET ../pages/{id}/content includes the page HTML and all defined data-id values
  • GET ../pages/{id}/content?includeIDs=true includes the page HTML and all defined data-id and generated id values

Note: The id values might change after a page update, so you should get the current values before building a request that uses them.

action

The action to perform on the target element.

Action Description
append Adds the supplied content to the target as a first or last child, as determined by the position attribute. Applies only to body, div, ol, and ul targets.
insert Adds the supplied content as a sibling before or after the target, as determined by the position attribute.
prepend Adds the supplied content to the target as a first child. Shortcut for append + before.
replace Replaces the target with the supplied content. Most elements that support replace require using the id as the target value.

position

The location to add the supplied content, relative to the target element. Used with append or insert actions. Defaults to after if omitted.

Position Description
after (with append) The last child of the target element.
before (with append) The first child of the target element.
after (with insert) The subsequent sibling of the target element.
before (with insert} The preceding sibling of the target element.

content

A string of well-formed HTML to add to the page and any image or file binary data. If the content contains binary data, the request must be sent using the multipart/form-data content type.

Supported elements and actions

Element Replace Append/prepend child Insert sibling
body (first div on the page) no YES no
div (absolutely positioned) no YES no
div (within a div) YES* YES YES
img, object (within a div) YES no YES
ol, ul YES* YES YES
table YES* no YES
p, li, h1-h6 YES* no YES
title YES no no

YES* - replace using generated id values only. You can get generated IDs by using the includeIDs query string option when you get page content.

The following elements do not support any PATCH actions:

  • img or object (absolutely positioned)
  • meta, head
  • tr, td
  • a, span, any style tags

Note: Absolutely positioned div, img, or object elements are direct children of the page body that define style=postion:absolute.

Use PATCH requests to change page indentation level (Beta).

PATCH /beta/me/notes/pages/{id}

Beta Change the indentation level of a page.

Valid page-level values are 0 (no indentation), 1, or 2. You cannot change the level of the first page in a section.

To get the current page level and order, send a GET ../pages/{id}?pagelevel=true or GET ../sections/{id}/pages?pagelevel=true request.

id

The ID of the page.

type
string
in
path
Request Example
{
  "level": "1"
}
204 No Content

No Content

Bearer Auth office.onenote_update , office.onenote_update_by_app

Update page content.

PATCH /v1.0/me/notes/pages/{id}/content

Every PATCH ../page/{id}/content request is comprised of an array of JSON objects to define changes, including the actions append, insert, prepend, and replace.

This example defines insert, replace, and append actions for different elements on a page.

[ {

'target':'#intro',
'action':'insert',
'position':'before',
'content':'<img src="image-url" alt="New image from a URL" />'

}, {

'target':'table:{de3e0977-94e4-4bb0-8fee-0379eaf47486}{11}',
'action':'replace',
'content':'<table data-id="football">
  <tr>
	<td><p><b>Brazil</b></p></td>
	<td><p>Germany</p></td>
  </tr>
  <tr>
	<td><p>France</p></td>
	<td><p><b>Italy</b></p></td>
  </tr>
  <tr>
	<td><p>Netherlands</p></td>
	<td><p><b>Spain</b></p></td>
  </tr>
  <tr>
	<td><p>Argentina</p></td>
	<td><p><b>Germany</b></p></td>
  </tr>
</table>'

}, {

'target':'#list-id',
'action':'append',
'content':'<li>Item at the bottom of the list</li>'

} ]

id

The ID of the page.

type
string
in
path
Request Example
[
  {
	"target": "#item",
	"action": "append",
	"content": "<p>A new paragraph at the bottom of the container #item</p>"
  },
  {
	"target": "#item",
	"action": "append",
	"position": "before",
	"content": "<h2>A subheader at the top of the container #item</h2>"
  }
]
204 No Content

No Content

POST Notebooks

POST /v1.0/me/notes/notebooks

Production Creates a new notebook for the user in Microsoft OneDrive.

Request Example
{
  "name": "Notebook Name"
}
201 Created

Created

Response Content-Types: application/json
Response Example (201 Created)
{
  "createdBy": "user name",
  "createdTime": "2013-10-05T10:57:00.683Z",
  "id": "notebook ID",
  "isDefault": false,
  "isShared": false,
  "lastModifiedBy": "user name",
  "lastModifiedTime": "2014-01-28T18:49:00.47Z",
  "links": {
	"oneNoteClientUrl": {
	  "href": "onenote:https://{client URL}"
	},
	"oneNoteWebUrl": {
	  "href": "https://{web URL}"
	}
  },
  "name": "notebook name",
  "sectionGroupsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sectionGroups",
  "sectionsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sections",
  "self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}",
  "userRole": "Contributor"
}

POST SectionGroups

Please note that creating section group functionality is currently in BETA! We encourage you to try the API and provide us feedback.

POST /v1.0/me/notes/notebooks/{id}/sectionGroups

Production Creates a new section group in the specified notebook.

id

The id of the notebook where you want to create the section group.

type
string
in
path
Request Example
{
  "name": "Section Group Name"
}
201 Created

Created

Response Content-Types: application/json
Response Example (201 Created)
{
  "createdBy": "username",
  "createdTime": "2015-06-03T21:31:56.513Z",
  "id": "{section group ID}",
  "lastModifiedBy": "username",
  "lastModifiedTime": "2015-06-03T21:31:56.513Z",
  "name": "My Section Group Name",
  "sectionGroupsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sectionGroups",
  "sectionsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sections",
  "self": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}"
}

POST /v1.0/me/notes/sectionGroups/{id}/sectionGroups

Production Creates a new section group in the specified section group.

id

The id of the section group where you want to create the section group.

type
string
in
path
Request Example
{
  "name": "Section Group Name"
}
201 Created

Created

Response Content-Types: application/json
Response Example (201 Created)
{
  "createdBy": "username",
  "createdTime": "2015-06-03T21:31:56.513Z",
  "id": "{section group ID}",
  "lastModifiedBy": "username",
  "lastModifiedTime": "2015-06-03T21:31:56.513Z",
  "name": "My Section Group Name",
  "sectionGroupsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sectionGroups",
  "sectionsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sections",
  "self": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}"
}

GET SectionGroups

GET /v1.0/me/notes/notebooks/{id}/sectiongroups

Production Gets a collection of section groups inside a specific notebook.

id

The id of the notebook that contains the section group.

type
string
in
path
filter

A Boolean expression for whether to include a particular entry.

type
string
in
query
orderby

Comma-delimited expression specifying order. Default is name asc.

type
string
in
query
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
top

Specifies to return only the first n results.

type
number
in
query
skip

Specifies to skip the first n results, typically used for paging.

type
number
in
query
count

Specifies to include the count of the returned collection.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "odata.context": "https://www.onenote.com/api/v1.0/$metadata#me/notes/sectionGroups(parentSectionGroup(id,name,self),parentNotebook(id,name,self))",
  "value": [
	{
	  "createdBy": "username",
	  "createdTime": "2015-06-03T21:31:56.513Z",
	  "id": "{section group ID}",
	  "lastModifiedBy": "username",
	  "lastModifiedTime": "2015-06-03T21:31:56.513Z",
	  "name": "My Section Group Name",
	  "sectionGroupsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sectionGroups",
	  "sectionsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sections",
	  "self": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}"
	}
  ]
}

GET /v1.0/me/notes/sectiongroups

Production Gets all section groups to which a user has access in all OneNote notebooks that are stored in Microsoft OneDrive. This includes section groups in notebooks that are both owned by and shared with the user. You can also retrieve all section groups to which a user has access inside a specific notebook or section group.

filter

A Boolean expression for whether to include a particular entry.

type
string
in
query
orderby

Comma-delimited expression specifying order. Default is name asc.

type
string
in
query
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
top

Specifies to return only the first n results.

type
number
in
query
skip

Specifies to skip the first n results, typically used for paging.

type
number
in
query
count

Specifies to include the count of the returned collection.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "odata.context": "https://www.onenote.com/api/v1.0/$metadata#me/notes/sectionGroups(parentSectionGroup(id,name,self),parentNotebook(id,name,self))",
  "value": [
	{
	  "createdBy": "username",
	  "createdTime": "2015-06-03T21:31:56.513Z",
	  "id": "{section group ID}",
	  "lastModifiedBy": "username",
	  "lastModifiedTime": "2015-06-03T21:31:56.513Z",
	  "name": "My Section Group Name",
	  "sectionGroupsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sectionGroups",
	  "sectionsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sections",
	  "self": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}"
	}
  ]
}

GET /v1.0/me/notes/sectiongroups/{id}

Production Gets a specific section group.

id

The id of the section group.

type
string
in
path
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "createdBy": "username",
  "createdTime": "2015-06-03T21:31:56.513Z",
  "id": "{section group ID}",
  "lastModifiedBy": "username",
  "lastModifiedTime": "2015-06-03T21:31:56.513Z",
  "name": "My Section Group Name",
  "sectionGroupsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sectionGroups",
  "sectionsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sections",
  "self": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}"
}

GET /v1.0/me/notes/sectiongroups/{id}/sectiongroups

Production Gets a collection of section groups inside a specific section group.

id

The id of the parent section group.

type
string
in
path
filter

A Boolean expression for whether to include a particular entry.

type
string
in
query
orderby

Comma-delimited expression specifying order. Default is name asc.

type
string
in
query
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
top

Specifies to return only the first n results.

type
number
in
query
skip

Specifies to skip the first n results, typically used for paging.

type
number
in
query
count

Specifies to include the count of the returned collection.

type
boolean
in
query
200 OK

OK

Response Example (200 OK)
{
  "createdBy": "username",
  "createdTime": "2015-06-03T21:31:56.513Z",
  "id": "{section group ID}",
  "lastModifiedBy": "username",
  "lastModifiedTime": "2015-06-03T21:31:56.513Z",
  "name": "My Section Group Name",
  "sectionGroupsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sectionGroups",
  "sectionsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sections",
  "self": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}"
}

GET Sections

GET /v1.0/me/notes/notebooks/{id}/sections

Production Gets a collection of sections from the specified notebook.

id

The id of the notebook that contains the section.

type
string
in
path
filter

A Boolean expression for whether to include a particular entry.

type
string
in
query
orderby

Comma-delimited expression specifying order. Default is name asc.

type
string
in
query
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
top

Specifies to return only the first n results.

type
number
in
query
skip

Specifies to skip the first n results, typically used for paging.

type
number
in
query
count

Specifies to include the count of the returned collection.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "odata.context": "https://www.onenote.com/api/v1.0/$metadata#me/notes/sections(parentSectionGroup(id,name,self),parentNotebook(id,name,self))",
  "value": [
	{
	  "createdBy": "name",
	  "createdTime": "2014-09-09T21:52:12.773Z",
	  "id": "{section ID}",
	  "isDefault": false,
	  "lastModifiedBy": "name",
	  "lastModifiedTime": "2014-09-09T21:52:42.29Z",
	  "name": "sectionname",
	  "pagesUrl": "https://www.onenote.com/api/v1.0/sections/{section ID}/pages",
	  "parentNotebook": {
		"id": "notebook ID",
		"name": "notebook name",
		"self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}"
	  },
	  "parentSectionGroup": {
		"id": "section group ID",
		"name": "section group name",
		"self": "https://www.onenote.com/api/v1.0/notebooks/{section group ID}"
	  },
	  "self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
	}
  ]
}

GET /v1.0/me/notes/sectiongroups/{id}/sections

Production Gets a collection of sections from the specified section group.

id

The id of the section group that contains the section.

type
string
in
path
filter

A Boolean expression for whether to include a particular entry.

type
string
in
query
orderby

Comma-delimited expression specifying order. Default is name asc.

type
string
in
query
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
top

Specifies to return only the first n results.

type
number
in
query
skip

Specifies to skip the first n results, typically used for paging.

type
number
in
query
count

Specifies to include the count of the returned collection.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "createdBy": "name",
  "createdTime": "2014-09-09T21:52:12.773Z",
  "id": "{section ID}",
  "isDefault": false,
  "lastModifiedBy": "name",
  "lastModifiedTime": "2014-09-09T21:52:42.29Z",
  "name": "sectionname",
  "pagesUrl": "https://www.onenote.com/api/v1.0/sections/{section ID}/pages",
  "parentNotebook": {
	"id": "notebook ID",
	"name": "notebook name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}"
  },
  "parentSectionGroup": {
	"id": "section group ID",
	"name": "section group name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{section group ID}"
  },
  "self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
}

GET /v1.0/me/notes/sections

Production Gets all sections to which a user has access in all OneNote notebooks that are stored in Microsoft OneDrive. This includes sections in notebooks that are both owned by and shared with the user. You can also retrieve all sections to which the user has access inside a specific notebook or section group.

filter

A Boolean expression for whether to include a particular entry.

type
string
in
query
orderby

Comma-delimited expression specifying order. Default is name asc.

type
string
in
query
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
top

Specifies to return only the first n results.

type
number
in
query
skip

Specifies to skip the first n results, typically used for paging.

type
number
in
query
count

Specifies to include the count of the returned collection.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "createdBy": "name",
  "createdTime": "2014-09-09T21:52:12.773Z",
  "id": "{section ID}",
  "isDefault": false,
  "lastModifiedBy": "name",
  "lastModifiedTime": "2014-09-09T21:52:42.29Z",
  "name": "sectionname",
  "pagesUrl": "https://www.onenote.com/api/v1.0/sections/{section ID}/pages",
  "parentNotebook": {
	"id": "notebook ID",
	"name": "notebook name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}"
  },
  "parentSectionGroup": {
	"id": "section group ID",
	"name": "section group name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{section group ID}"
  },
  "self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
}

GET /v1.0/me/notes/sections/{id}

Production Gets a specific section inside a OneNote notebook that is stored in Microsoft OneDrive. This can be a section in a notebook that is either owned by or shared with the user.

id

The id of the section.

type
string
in
path
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "createdBy": "name",
  "createdTime": "2014-09-09T21:52:12.773Z",
  "id": "{section ID}",
  "isDefault": false,
  "lastModifiedBy": "name",
  "lastModifiedTime": "2014-09-09T21:52:42.29Z",
  "name": "sectionname",
  "pagesUrl": "https://www.onenote.com/api/v1.0/sections/{section ID}/pages",
  "parentNotebook": {
	"id": "notebook ID",
	"name": "notebook name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}"
  },
  "parentSectionGroup": {
	"id": "section group ID",
	"name": "section group name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{section group ID}"
  },
  "self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
}

POST Sections

POST /v1.0/me/notes/notebooks/{id}/sections

Production Creates a new section in the specified notebook on Microsoft OneDrive.

id

The id of the notebook where you want to create the section.

type
string
in
path
Request Example
{
  "name": "Section Name"
}
201 Created

Created

Response Content-Types: application/json
Response Example (201 Created)
{
  "createdBy": "name",
  "createdTime": "2014-09-09T21:52:12.773Z",
  "id": "{section ID}",
  "isDefault": false,
  "lastModifiedBy": "name",
  "lastModifiedTime": "2014-09-09T21:52:42.29Z",
  "name": "sectionname",
  "pagesUrl": "https://www.onenote.com/api/v1.0/sections/{section ID}/pages",
  "parentNotebook": {
	"id": "notebook ID",
	"name": "notebook name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}"
  },
  "parentSectionGroup": {
	"id": "section group ID",
	"name": "section group name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{section group ID}"
  },
  "self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
}

POST /v1.0/me/notes/sectionGroups/{id}/sections

Production Creates a new section in the specified section group on Microsoft OneDrive.

Please note that creating a section in a section group is currently in BETA! We encourage you to try the API and provide us feedback.

id

The id of the section group where you want to create the section.

type
string
in
path
Request Example
{
  "name": "Section Name"
}
201 Created

Created

Response Content-Types: application/json
Response Example (201 Created)
{
  "createdBy": "name",
  "createdTime": "2014-09-09T21:52:12.773Z",
  "id": "{section ID}",
  "isDefault": false,
  "lastModifiedBy": "name",
  "lastModifiedTime": "2014-09-09T21:52:42.29Z",
  "name": "sectionname",
  "pagesUrl": "https://www.onenote.com/api/v1.0/sections/{section ID}/pages",
  "parentNotebook": {
	"id": "notebook ID",
	"name": "notebook name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}"
  },
  "parentSectionGroup": {
	"id": "section group ID",
	"name": "section group name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{section group ID}"
  },
  "self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
}

GET Pages

The pages endpoint represents all the OneNote pages across all notebooks in OneDrive that are both owned by and shared with the user. You can get pages across all notebooks, get pages in a specific section, get a specific page, or get the HTML content of a page.

The OneNote API returns page metadata as JSON objects that conform to the OData version 4.0 specification.

GET /v1.0/me/notes/pages

Production Gets a collection of pages (metadata) across all notebooks in OneDrive that the user can access.

filter

A Boolean expression for whether to include a particular entry.

type
string
in
query
orderby

Comma-delimited expression specifying order. Default is lastModifiedTime desc.

type
string
in
query
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
top

Specifies to return only the first n results. Default is 20, maximum is 100.

type
number
in
query
skip

Specifies to skip the first n results, typically used for paging.

type
number
in
query
search

Specifies the term or phrase to search for in the page title, page body, image alt text, and image OCR text.

type
string
in
query
count

Specifies to include the count of the returned collection.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "odata.context": "https://www.onenote.com/api/v1.0/$metadata#me/notes/pages",
  "value": [
	{
	  "contentUrl": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}/content",
	  "createdByAppId": "WLID-0000000038118631",
	  "createdTime": "2013-05-27T17:53:24.158Z",
	  "id": "{page ID}!{section ID}",
	  "lastModifiedTime": "2015-02-05T21:01:39.18Z",
	  "links": {
		"oneNoteClientUrl": {
		  "href": "onenote:https://{client URL}"
		},
		"oneNoteWebUrl": {
		  "href": "https://{web URL}"
		}
	  },
	  "parentSection": {
		"id": "{section ID}",
		"name": "Quick Notes",
		"self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
	  },
	  "parentSection@odata.context": "https://www.onenote.com:576/api/v1.0/$metadata#me/notes/pages('{page ID}!{section ID}')/parentSection(id,name,self)/$entity",
	  "self": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}",
	  "title": "Bike Carriers for Car"
	}
  ]
}

GET /v1.0/me/notes/pages/{id}

Production Gets a specific page object (metadata).

id

The id of page.

type
string
in
path
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
pagelevel

Returns the level and order properties of the page.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "contentUrl": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}/content",
  "createdByAppId": "WLID-0000000038118631",
  "createdTime": "2013-05-27T17:53:24.158Z",
  "id": "{page ID}!{section ID}",
  "lastModifiedTime": "2015-02-05T21:01:39.18Z",
  "links": {
	"oneNoteClientUrl": {
	  "href": "onenote:https://{client URL}"
	},
	"oneNoteWebUrl": {
	  "href": "https://{web URL}"
	}
  },
  "parentSection": {
	"id": "{section ID}",
	"name": "Quick Notes",
	"self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
  },
  "parentSection@odata.context": "https://www.onenote.com:576/api/v1.0/$metadata#me/notes/pages('{page ID}!{section ID}')/parentSection(id,name,self)/$entity",
  "self": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}",
  "title": "Bike Carriers for Car"
}

GET /v1.0/me/notes/pages/{id}/content

Production Gets the HTML content of a specific page, including element IDs for use in PATCH requests.

The output HTML provides a semantic description of the page content and structure, and can contain all of the supported tags that are described in HTML tag support for pages, with a few additional elements and properties.

If the page contains embedded images or files, the returned img and object elements contain the path to the image or file resource, for example: https://www.onenote.com/api/v1.0/resources/{id}/$value. You can make separate GET requests to these endpoints to retrieve the binary contents of the images and files.

Be sure to use the preAuthenticated=true query string option if you want to render the images directly in a browser. Otherwise, the images won't render because they are private and require authorization to retrieve them (like the rest of the page content).

id

The ID of the page.

type
string
in
path
includeIDs

'true' to include auto-generated element IDs.

type
string
in
query
preAuthenticated

'true' to return URLs that temporarily enable public access to the image resources on the page.

type
string
in
query
200 OK

OK

Response Content-Types: text/html
Response Example (200 OK)
"<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en-US\"> [NL][T] <head> [NL][T][T] <title>Last summer</title> [NL][T][T] <meta name=\"created\" content=\"2015-03-09T12:34: [NL][T][T][T] 00.0000000\" /> [NL][T] </head> [NL][T] <body data-absolute-enabled=\"true\" [NL][T][T] style=\"font-family:Calibri;font-size:11pt\"> [NL][T][T] <div id=\"div:{5be357b1-f1ee-4b07-9d93- [NL][T][T][T] ff1084cedfa9}{32}\" data-id=\"_default\" style= [NL][T][T][T] \"position:absolute;left:48px;top:120px; [NL][T][T][T] width:576px\"> [NL][T][T][T] <h1 id=\"h1:{5be357b1-f1ee-4b07-9d93-ff1084cedfa9} [NL][T][T][T][T] {38}\" style=\"font-size:16pt;color:#1e4e79; [NL][T][T][T][T] margin-top:11pt;margin-bottom:11pt\">What I did [NL][T][T][T][T] last summer</h1> [NL][T][T][T] <p id=\"p:{5be357b1-f1ee-4b07-9d93-ff1084cedfa9}{40}\"> [NL][T][T][T][T] Went to Monument Valley.</p> [NL][T][T][T] <p id=\"p:{5be357b1-f1ee-4b07-9d93-ff1084cedfa9}{42}\"> [NL][T][T][T][T] Went to Canyon de Chelly.</p> [NL][T][T][T] <img id=\"img:{79639f1f-18e3-064c-03e1-6a930902047e}{20}\" [NL][T][T][T][T] width=\"103\" height=\"103\" src=\"https://www.onenote.com [NL][T][T][T][T] /api/v1.0/resources/0-d3d46ab3539e4e13a11e0bd4a3c91c1d! [NL][T][T][T][T] 1-73DBAF9B7E5C4B4C!10551/$value\" [NL][T][T][T][T] data-src-type=\"image/jpeg\" data-fullres-src= [NL][T][T][T][T] \"https://www.onenote.com/api/v1.0/resources/ [NL][T][T][T][T] 0-d3d46ab3539e4e13a11e0bd4a3c91c1d! [NL][T][T][T][T] 1-73DBAF9B7E5C4B4C!10551/$value\" [NL][T][T][T][T] data-fullres-src-type=\"image/jpeg\" /> [NL][T][T] </div> [NL][T] </body> [NL] </html>"

GET /v1.0/me/notes/pages/{id}/preview

Production Gets preview content for a specific page.

The returned previewText property contains a text snippet from the page. The OneNote API returns complete phrases, up to a maximum of 300 characters.

If the page has an image that can be used to build a preview UI, the href property in the previewImageUrl object contains a link to a public, pre-authenticated image resource. You can use this link in HTML. For example: <img src="https://www.onenote.com/api/v1.0/resources/{id}/content?publicAuth=true&mimeType=image/png" /> Otherwise, href returns null.

id

The ID of the page.

type
string
in
path
200 OK

OK

Response Content-Types: application/json; charset=utf-8
Response Example (200 OK)
"{ [NL][T] \"odata.context\":\"https://www.onenote.com/api/v1.0/$metadata [NL][T][T] #Microsoft.OneNote.Api.PagePreview\", [NL][T] \"previewText\":\"text-snippet-from-page\", [NL][T] \"links\": { [NL][T][T] \"previewImageUrl\":{ [NL][T][T][T] \"href\":\"https://www.onenote.com/api/v1.0/resources/{id} [NL][T][T][T][T] /content?publicAuth=true&mimeType=image/png\" [NL][T][T] } [NL][T] } [NL] }"

GET /v1.0/me/notes/sections/{id}/pages

Production Gets a collection of pages (metadata) under the specified section.

id

The id of section that contains the page collection.

type
string
in
path
filter

A Boolean expression for whether to include a particular entry.

type
string
in
query
orderby

Comma-delimited expression specifying order. Default is lastModifiedTime desc.

type
string
in
query
select

Comma-delimited expression specifying the properties to return.

type
string
in
query
expand

Comma-delimited expression specifying the navigation properties to return inline.

type
string
in
query
top

Specifies to return only the first n results. Default is 20, maximum is 100.

type
number
in
query
skip

Specifies to skip the first n results, typically used for paging.

type
number
in
query
search

Specifies the term or phrase to search for in the page title, page body, image alt text, and image OCR text.

type
string
in
query
count

Specifies to include the count of the returned collection.

type
boolean
in
query
pagelevel

Returns the level and order properties of the pages.

type
boolean
in
query
200 OK

OK

Response Content-Types: application/json
Response Example (200 OK)
{
  "contentUrl": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}/content",
  "createdByAppId": "WLID-0000000038118631",
  "createdTime": "2013-05-27T17:53:24.158Z",
  "id": "{page ID}!{section ID}",
  "lastModifiedTime": "2015-02-05T21:01:39.18Z",
  "links": {
	"oneNoteClientUrl": {
	  "href": "onenote:https://{client URL}"
	},
	"oneNoteWebUrl": {
	  "href": "https://{web URL}"
	}
  },
  "parentSection": {
	"id": "{section ID}",
	"name": "Quick Notes",
	"self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
  },
  "parentSection@odata.context": "https://www.onenote.com:576/api/v1.0/$metadata#me/notes/pages('{page ID}!{section ID}')/parentSection(id,name,self)/$entity",
  "self": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}",
  "title": "Bike Carriers for Car"
}

POST Pages

If there is no default notebook, or if the notebook doesn't have a Quick Notes section, the OneNote API creates them. After the notebook and section are available, the new page will be created.

The POST can either contain HTML placed directly in the request body, or it can use a multi-part message format. The multi-part format used to create a page supports a single "Presentation" part containing HTML that defines the page layout, and other data parts to be used in the page. Those data parts can contain image binary data, file binary data, or HTML that will be rendered as an image and placed on the OneNote page.

See the HTML tag support section for the set of HTML tags that you can include in your HTTP request body or in the "Presentation" MIME part.

Request the office.onenote_create scope when you authenticate in order to give your product the ability to create pages.

Notes on the sectionName parameter

If you don't specify a section (with the sectionName parameter), the Microsoft OneNote API creates pages inside the "Quick Notes" section of the user's default notebook. The default notebook is typically named using their first name, for example John Doe's might be "John's Notebook", or "My Notebook", or even "Personal".

The sectionName parameter applies only to the default location endpoint: HTTPS://www.onenote.com/api/v1.0/pages. It's not applicable when you're using the /pages endpoint for a specific section.

Only top-level sections can be created or referenced with the sectionName parameter, and only in the default OneNote notebook. Sections inside OneNote section groups cannot be created, or referenced, even if they already exist.

Section names are case-insensitive for matching, but the case is preserved when they are created. So "My New Section" will be displayed like that, but "my new section" would also match on subsequent posts.

Some characters are not allowed. If you include ? * \ / : < > | & # " % ~ you'll receive an error from the API. Single-quotes (apostrophes) are allowed, like in "John's Restaurant Reviews", but double-quotes are not.

The new section name must be URL-encoded. For example, spaces must be encoded as %20.

Users might rename sections, in which case the API will create a new section with the sectionName you supply.

Example request (non-multi-part)

 Content-Type:text/html [NL] Authorization:Bearer tokenString [NL][NL] <!DOCTYPE html> [NL] <html> [NL][T] <head> [NL][T][T] <title>Title of the captured OneNote page</title> [NL][T][T] <meta name="created" content="2013-06-11T12:45:00.000-8:00"/> [NL][T] </head> [NL][T] <body> [NL][T][T] <p>This is a simple non-multi-part HTML page.</p> [NL][T] </body> [NL] </html>

In the Authorization header, replace tokenString with the actual OAuth token.

The HTML has to be XML compatible, so be sure to close tags and include quote-marks around attributes.

The <title> and <meta name="created"> tags in the <head> section are used for the title and created date of your new OneNote page.

To include images that are available as a URL in that simple HTML, you can, using the standard <img src="..."/>. Be aware that the image must be available on the Internet to the OneNote API without requiring authentication, so be careful of images located on a company's intranet that cannot be accessed by the API.

Example request (multi-part)

 Content-Type:multipart/form-data; boundary=MyAppPartBoundary [NL] Authorization:Bearer tokenString [NL][NL] --MyAppPartBoundary [NL] Content-Disposition:form-data; name="Presentation" [NL] Content-type:text/html [NL][NL] ... presentation part html data ... [NL][NL] --MyAppPartBoundary [NL] Content-Disposition:form-data; name="imagePart-1" [NL] Content-type:image/jpeg [NL][NL] ... image binary data ... [NL][NL] --MyAppPartBoundary [NL] Content-Disposition:form-data; name="htmlToRender-1" [NL] Content-type:text/html [NL][NL] ... html data ... [NL][NL] --MyAppPartBoundary [NL] Content-Disposition:form-data; name="EmbeddedFilePartName1" [NL] Content-type:application/vnd.openxmlformats-officedocument.wordprocessingml.document [NL][NL] ... binary file data ... [NL][NL] --MyAppPartBoundary--

The request includes the required "Presentation" part, a binary image data part, an HTML part, and a binary file data part.

The HTML in the "Presentation" part specifies the overall page layout that OneNote will create in the user's notebook.

Separate each MIME part with a line starting with two hyphens followed by the boundary string specified in the Content-Type declaration. Leading whitespace is not allowed. The end of the last message part has two more hyphens after the boundary string.

Each of the parts in a OneNote API POST must have a Content-Disposition part header that tells the API how to handle the part and its name. The only accepted part-level Content-Disposition is form-data at this time. Each MIME part must also have a Content-Type header indicating the format of the data in that part.

All multi-part requests must have a "Presentation" part, and depending on what you're capturing, might have one or more image or HTML data parts. If your POST request has more than one part, the part order is not important: the Presentation part can be anywhere in the list of parts, but it must be included somewhere.

Many MIME-encoding libraries can construct the above structure for you, so you might already have this capability and not need to code it manually.

Each part name must be unique. The OneNote API will throw an error if your request contains duplicate part names.

The examples in this documentation give easily-recognizable string values for the part names and part boundaries. This is not the part-naming typically used in production apps. In most apps, part names include a string followed by some effectively random, unique string, like the current time in milliseconds, or a GUID. For example, "MyAppBoundrary-73720000422322" or "ImageDataBlock-d2d6aaf5-3bde-4ee7-ba18-27727bf3cffe". Remember, however, that "Presentation" is a special part name, and is required in all multi-part POST requests.

Example "Presentation" part (required in multi-part requests)

 Content-Type:multipart/form-data; boundary=MyAppPartBoundary [NL] Authorization:Bearer tokenString [NL][NL] --MyAppPartBoundary [NL] Content-Disposition:form-data; name="Presentation" [NL] Content-type:text/html [NL][NL] <!DOCTYPE html> [NL] <html> [NL][T] <head> [NL][T][T] <title>Title of the captured OneNote page</title> [NL][T][T] <meta name="created" content="2013-06-11T12:45:00.000-8:00"/> [NL][T] </head> [NL][T] <body> [NL][T][T] <p>This is a simple Presentation block.</p> [NL][T] </body> [NL] </html> [NL][NL] --MyAppPartBoundary--

The <head> contents in the "Presentation" part supply the title and creation date/time that OneNote uses for the new page.

The HTML in the "Presentation" part should be XHTML-compliant. All tags should be closed, and attribute values should have surrounding double quote-marks ("...").

The DOCTYPE directive is optional, but recommended.

Example "Presentation" part with an HTML data part

Content-Type:multipart/form-data; boundary=MyAppPartBoundary [NL] Authorization:Bearer tokenString [NL][NL] --MyAppPartBoundary [NL] Content-Disposition:form-data; name="Presentation" [NL] Content-type:text/html [NL][NL] <!DOCTYPE html> [NL] <html> [NL][T] <head> [NL][T][T] <title>A simple page with an thumbnail image of some HTML</title> [NL][T] </head> [NL][T] <body> [NL][T][T] <img data-render-src="name:MyAppEmbeddedHtmlId" width="100"/> [NL][T] </body> [NL] </html> [NL][NL] --MyAppPartBoundary [NL] Content-Disposition:form-data; name="MyAppEmbeddedHtmlId" [NL] Content-type:text/html [NL][NL] <!DOCTYPE html> [NL] <html> [NL][T] <body> [NL][T][T] <h1>This is just amazing!</h1> [NL][T][T] <p>That's right, an HTML page captured as an image</p> [NL][T] </body> [NL] </html> [NL][NL] --MyAppPartBoundary--

Use the data-render-src attribute to render the data as a screen-shot image of the web page in the new page. This attribute can specify either a live internet URL or the name of a MIME part in the POST request. That HTML will be rendered and inserted into the page as an image. This can be especially useful when your app is capturing a page that requires the user be logged in, since the API isn't able to log in on behalf of the user.

You can refer to the same part name in multiple <img> tags.

Example "Presentation" part with image and file data binary parts

 Content-Type:multipart/form-data; boundary=MyAppPartBoundary [NL] Authorization:Bearer tokenString [NL][NL] --MyAppPartBoundary [NL] Content-Disposition:form-data; name="Presentation" [NL] Content-type:text/html [NL][NL] <!DOCTYPE html> [NL] <html> [NL][T] <head> [NL][T][T] <title>A simple page with an embedded image</title> [NL][T] </head> [NL][T] <body> [NL][T][T] <p>Here is a cool image I found.</p> [NL][T][T] <img src="name:AppPictureBlockName1" alt="a cool image" width="500"/> [NL][T][T] <p>Here is an embedded file.</p> [NL][T][T] <object data-attachment="EmbeddedFileDisplayName.docx" [NL][T] [T] data="name:EmbeddedFileBlocksName1" [NL][T][T]  type="application/vnd.openxmlformats-officedocument.wordprocessingml.document" /> [NL][T] </body> [NL] </html> [NL][NL] --MyAppPartBoundary [NL][T]  Content-Disposition:form-data; name="AppPictureBlockName1" [NL] Content-type:image/jpeg [NL][NL] ... binary image data ... [NL][NL] --MyAppPartBoundary-- [NL] Content-Disposition:form-data; name="EmbeddedFileBlockName1" [NL] Content-type:application/vnd.openxmlformats-officedocument.wordprocessingml.document [NL][NL] ... binary file data ... [NL][NL] --MyAppPartBoundary-- 

The example shows a "Presentation" part with an img tag that tells the API to add a 500-pixel wide image, with a binary image data in the MIME part named AppPictureBlockName1, and an embedded file in the MIME part named EmbeddedFileBlockName1. In this example, the file is a Microsoft Word document.

When you want to embed a file, use the <object> tag, as in the example above.

When you embed image data directly in the POST, you add the data as part of an image data MIME part, and refer to the image using the <img data-render-src="name:..."> tag.

Example multi-part request with absolutely positioned elements

The following example shows a multi-part request that creates a page containing a div, image, and file attachment that can be positioned independently of each other. Only div, img, and object elements that are direct children of the body can be absolutely positioned. The body must set data-absolute-enabled="true" and the absolutely positioned elements must specify style="position:absolute". See Create absolute positioned elements to learn more.

 Content-Type: multipart/form-data; boundary=acebdf13572468 [NL] Authorization:Bearer tokenString [NL][NL] --acebdf13572468 [NL] Content-Disposition:form-data; name="Presentation" [NL] Content-type:text/html [NL][NL] <html> [NL][T] <head> [NL][T][T] <title>Page with absolutely positioned elements</title>[NL][T] </head> [NL][T] <body data-absolute-enabled="true"> [NL][T][T] <div style="position:absolute;width:280px;top:120px;left:68px"> [NL][T][T][T] <p>Some text inside an absolutely positioned div.</p> [NL][T][T][T] <p>An absolutely positioned div can contain non-absolutely positioned elements, such as images and objects.</p> [NL][T][T] </div> [NL][T][T] <object style="position:absolute;top:225px;left:300px" data="name:embeddedFilePart" data-attachment="attachment.pdf" type="application/pdf" /> [NL][T][T] <img style="position:absolute;top:400px;left:150px;width:250px"  src="http://officeimg.vo.msecnd.net/en-us/files/018/949/ZA103278226.png" /> [NL][T] </body> [NL] </html> [NL][NL] --acebdf13572468 [NL] Content-Disposition: form-data; name="embeddedFilePart" [NL] Content-Type: application/pdf [NL][NL] ... file binary content ... [NL] --acebdf13572468--

POST /v1.0/me/notes/pages

Production Creates a new page in the user's default section and notebook. POST to the /pages endpoint for a specific section when you want to create a page in a location other than the default.

Request Content-Types: application/xhtml+xml
Request Example
"<?xml version=\"1.0\" encoding=\"utf-8\" ?> [NL] <html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en-us\"> [NL][T] <head> [NL][T][T] <title>Page from OneNote API console</title> [NL][T][T] <meta name=\"created\" content=\"2014-03-17T09:00:00-08:00\" /> [NL][T] </head> [NL][T] <body> [NL][T][T] <h1>HTML sample block</h1> [NL][T][T] <h2>The basics</h2> [NL][T][T] <p>For the most part, try to keep the HTML simple, and be [NL][T][T][T] sure to properly close all tags.</p> [NL][T][T] <p>Character encoding must be in UTF-8; the service doesn't [NL][T][T][T] accept other encodings</p> [NL][T][T] <h2>Overall structure</h2> [NL][T][T] <p>The normal &lt;html&gt;, &lt;head&gt; and &lt;body&gt; tags are expected, [NL][T][T][T] but the service is usually okay if they aren't [NL][T][T][T] included.</p> [NL][T][T] <p>Inside the &lt;head&gt; tag, we recognize only the &lt;title&gt; and [NL][T][T][T] one form of the &lt;meta&gt; tags.</p> [NL][T][T] <p>All includes, CSS, script, etc. inside the &lt;head&gt; and [NL][T][T][T] &lt;body&gt; blocks are ignored.</p> [NL][T][T] <p>As you can tell from the &lt;body&gt; tag's style attribute, [NL][T][T][T] in this HTML, the service ignores CSS styles</p> [NL][T][T] <h2>Block formatting</h2> [NL][T][T] <p>Paragraph (&lt;p&gt;) and line-break (&lt;br/&gt;) tags are [NL][T][T][T] handled properly. They get the &quot;Normal&quot; OneNote [NL][T][T][T] styling</p> [NL][T][T] <p>The &lt;div&gt; and &lt;span&gt; tags are recognized but generally [NL][T][T][T] don't have any significant effect, since CSS [NL][T][T][T] styling is ignored. A &lt;div&gt; tag acts like a &lt;p&gt; tag.</p> [NL][T][T] <p>The header tags &lt;h1&gt; through &lt;h6&gt; are recognized, [NL][T][T][T] and map to the OneNote Heading 1 through Heading 6 [NL][T][T][T] styles.</p> [NL][T][T] <h2>Simple character formatting</h2> [NL][T][T] <p>This paragraph shows how the API handles <b>HTML4+ [NL][T][T][T] bold &lt;b&gt;</b> tags</p> [NL][T][T] <p>...and <strong>HTML4+ strong &lt;strong&gt;</strong> tags</p> [NL][T][T] <p>...and <i>HTML4+ italics &lt;i&gt;</i> tags</p> [NL][T][T] <p>...and <em>HTML4+ emphasis &lt;em&gt;</em> tags</p> [NL][T][T] <p>...and <a href=\".\">HTML anchor &lt;a&gt;</a> tags.</p> [NL][T][T] <h2>Images</h2> [NL][T][T] <p>The &lt;img&gt; tag is supported. For example, here&apos;s a [NL][T][T][T] referenced image: </p> [NL][T][T] <img src=\"http://placecorgi.com/600\"/> [NL][T][T] <p>The OneNote API supports JPEG, GIF, TIFF and [NL][T][T][T] PNG images</p> [NL][T][T] <p>This next tag inserts a screenshot thumbnail image [NL][T][T][T] of the OneNote.com web page into the captured page, [NL][T][T][T] displayed as 500 pixels wide.</p> [NL][T][T] <img data-render-src=\"http://www.onenote.com\" width=\"500\"/> [NL][T][T] <h2>Tables</h2> [NL][T][T] <p>Tables are understood, but not table headers. [NL][T][T][T] Table headers are treated like normal rows. You can [NL][T][T][T] nest tables, but their content-layout ability is [NL][T][T][T] limited. </p> [NL][T][T] <p>Tables have to be &quot;regular&quot;, in that the service [NL][T][T][T] assumes all rows have same number of columns. Similarly, [NL][T][T][T] all columns have the same number of rows. More [NL][T][T][T] specifically, the service ignores colspan and rowspan [NL][T][T][T] attributes.</p> [NL][T][T] <p>You can set the table border to either \"0\" (no [NL][T][T][T] border) or \"1\" (with border).</p> [NL][T][T] <table border=\"1\"> [NL][T][T][T]<tr> [NL][T][T][T][T] <td>First row First column</td> [NL][T][T][T][T] <td>First row Second column</td> [NL][T][T][T] </tr> [NL][T][T][T]<tr> [NL][T][T][T][T] <td>Second row First column</td> [NL][T][T][T][T] <td>Second row Second column</td> [NL][T][T][T]</tr> [NL][T][T] </table> [NL][T][T] <p>Lists of both types (&lt;ol&gt; and &lt;ul&gt;) are supported, [NL][T][T][T] and can be nested. But, the &quot;type=&quot; attribute [NL][T][T][T] is ignored.</p> [NL][T][T] <ul> [NL][T][T][T]<li>First unordered list item</li> [NL][T][T][T] <li>Second unordered list item<br>which contains another [NL][T][T][T][T] list [NL][T][T][T][T] <ol> [NL][T][T][T][T] <li>First (nested) ordered list item</li> [NL][T][T][T][T] <li>Second (nested) ordered list item</li> [NL][T][T][T][T] </ol> [NL][T][T][T] </li> [NL][T][T] </ul> [NL][T][T] <h2>Not (yet) supported</h2> [NL][T][T] <p>Nested tables are supported, but table header rows [NL][T][T][T] (&lt;th&gt;) are treated like normal table rows (&lt;tr&gt;)</p> [NL][T][T] <p>CSS styles are ignored at this time.</p> [NL][T][T] <p>Scripts are ignored.</p> [NL][T][T] <p>Other tags (e.g, &lt;article&gt;, &lt;header&gt;, &lt;footer&gt;, [NL][T][T][T] &lt;section&gt; and &lt;aside&gt;) are largely ignored, but their [NL][T][T][T] otherwise-valid contents are included.</p> [NL][T] </body> [NL] </html>"
201 Created

Created

Response Content-Types: application/json; charset=utf-8
Response Example (201 Created)
{
  "contentUrl": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}/content",
  "createdByAppId": "WLID-0000000038118631",
  "createdTime": "2013-05-27T17:53:24.158Z",
  "id": "{page ID}!{section ID}",
  "lastModifiedTime": "2015-02-05T21:01:39.18Z",
  "links": {
	"oneNoteClientUrl": {
	  "href": "onenote:https://{client URL}"
	},
	"oneNoteWebUrl": {
	  "href": "https://{web URL}"
	}
  },
  "parentSection": {
	"id": "{section ID}",
	"name": "Quick Notes",
	"self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
  },
  "parentSection@odata.context": "https://www.onenote.com:576/api/v1.0/$metadata#me/notes/pages('{page ID}!{section ID}')/parentSection(id,name,self)/$entity",
  "self": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}",
  "title": "Bike Carriers for Car"
}

POST /v1.0/me/notes/pages?sectionName

Production Creates a new page in the specified section of the user's default notebook. If the section doesn't exist (or was renamed), the API will create the section.

Request Content-Types: application/xhtml+xml
Request Example
"<?xml version=\"1.0\" encoding=\"utf-8\" ?> [NL]<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en-us\"> [NL][T] <head> [NL][T][T] <title>This is an article from the Reader clipper</title> [NL][T][T] <meta name=\"created\" content=\"2013-10-22T20:18:49. [NL][T][T][T] 2056393-07:00\"> [NL][T] </head> [NL][T] <body> [NL][T][T] <h1>Read all about it</h1> [NL][T][T] <p> [NL][T][T][T] Lorem ipsum etc with some formatting: <b>bold</b>, [NL][T][T][T] <i>italics</i>, <u>underlined</u> [NL][T][T] </p> [NL][T][T] <table> [NL][T][T][T] <tr> [NL][T][T][T][T] <td>First cell</td> [NL][T][T][T][T] <td>Second cell</td> [NL][T][T][T] </tr> [NL][T][T] </table> [NL][T][T] <img src=\"http://placecorgi.com/600\" alt=\"alt text\" [NL][T][T][T] width=\"45\" height=\"45\" /> [NL][T][T] <p>Some more stuff</p> [NL][T][T] <img src=\"http://placecorgi.com/600\" alt=\"alt text\" [NL][T][T][T] width=\"45\" height=\"45\" /> [NL][T][T] <br/> [NL][T][T] From http://www.cnn.com [NL][T] </body> [NL] </html>"
201 Created

Created

Response Content-Types: application/json; charset=utf-8
Response Example (201 Created)
{
  "contentUrl": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}/content",
  "createdByAppId": "WLID-0000000038118631",
  "createdTime": "2013-05-27T17:53:24.158Z",
  "id": "{page ID}!{section ID}",
  "lastModifiedTime": "2015-02-05T21:01:39.18Z",
  "links": {
	"oneNoteClientUrl": {
	  "href": "onenote:https://{client URL}"
	},
	"oneNoteWebUrl": {
	  "href": "https://{web URL}"
	}
  },
  "parentSection": {
	"id": "{section ID}",
	"name": "Quick Notes",
	"self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
  },
  "parentSection@odata.context": "https://www.onenote.com:576/api/v1.0/$metadata#me/notes/pages('{page ID}!{section ID}')/parentSection(id,name,self)/$entity",
  "self": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}",
  "title": "Bike Carriers for Car"
}

POST /v1.0/me/notes/sections/{id}/pages

Production Creates a new page in the specified section.

id

The id of section where the page is to be created.

type
string
in
path
Request Content-Types: application/xhtml+xml
Request Example
"<?xml version=\"1.0\" encoding=\"utf-8\" ?> [NL] <html>[NL][T] <head> [NL][T][T] <title>Page with an absolutely positioned div [NL][T][T][T] and image</title> [NL][T] </head> [NL][T] <body data-absolute-enabled=\"true\"> [NL][T][T] <div style=\"position:absolute;width:280px;top:120px; [NL][T][T][T] left:68px\"> [NL][T][T][T] <p>Divs, images, and objects that are direct children [NL][T][T][T][T] of the body can be absolutely positioned elements [NL][T][T][T][T] on the page.</p> [NL][T][T][T] <p>The body must specify data-absolute-enabled=&quot;true&quot; [NL][T][T][T][T] and the absolutely positioned elements must [NL][T][T][T][T][T] specify style=&quot;position:absolute&quot;.</p> [NL][T][T][T] <p>An absolutely positioned div can contain non- [NL][T][T][T][T] absolutely positioned elements, such as images [NL][T][T][T][T] and objects.</p> [NL][T][T] </div> [NL][T][T] <img style=\"position:absolute;top:120px;left:360px; [NL][T][T][T] width:250px\"  src=\"http://placecorgi.com/600\" />[NL][T] </body> [NL] </html>"
201 Created

Created

Response Content-Types: application/json; charset=utf-8
Response Example (201 Created)
{
  "contentUrl": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}/content",
  "createdByAppId": "WLID-0000000038118631",
  "createdTime": "2013-05-27T17:53:24.158Z",
  "id": "{page ID}!{section ID}",
  "lastModifiedTime": "2015-02-05T21:01:39.18Z",
  "links": {
	"oneNoteClientUrl": {
	  "href": "onenote:https://{client URL}"
	},
	"oneNoteWebUrl": {
	  "href": "https://{web URL}"
	}
  },
  "parentSection": {
	"id": "{section ID}",
	"name": "Quick Notes",
	"self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
  },
  "parentSection@odata.context": "https://www.onenote.com:576/api/v1.0/$metadata#me/notes/pages('{page ID}!{section ID}')/parentSection(id,name,self)/$entity",
  "self": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}",
  "title": "Bike Carriers for Car"
}

DELETE Pages

You can't recover deleted data, so be careful when using this method. Deleting pages using the API deletes them permanently. They are not added to the OneNote Recycle Bin.

DELETE /v1.0/me/notes/pages/{id}

Production Deletes the specified page.

id

The ID of the page to delete.

type
string
in
path
204 No Content

No Content

PATCH Sections

You can use a PATCH request to change the name of a section.

PATCH /v1.0/me/notes/sections/{id}

Production Renames the specified section.

id

The id of the section to update.

type
string
in
path
Request Example
{
  "name": "Section Name"
}
204 No Content

No Content

Bearer Auth office.onenote_update , office.onenote_update_by_app

Schema Definitions

Notebook:

isDefault: Boolean

Indicates whether this is the user’s default section.

userRole: string Owner, Contributor, Reader

One of three values: Owner, Contributor, or Reader. If the value is Owner, the user has owner-level access to the notebook. If the value is Contributor, the user has read/write access to the notebook. If the value is Reader, the user has read-only access to the notebook.

isShared: Boolean

Indicates whether the notebook is shared. If true, the contents of the notebook can be seen by people other than the owner.

sectionsUrl: string

The /sections endpoint where you can get details for all the sections in the notebook.

sectionGroupsUrl: string

The /sectiongroups endpoint where you can get details for all the section groups in the notebook.

sections: Collection(Section)

The sections in the notebook. Can be navigated to using the sectionsUrl property or expanded in a GET request.

sectionGroups: Collection(SectionGroup)

The section groups in the notebook. Can be navigated to using the sectionGroupsUrl property or expanded in a GET request.

links: object

The value of oneNoteClientURL can be used to open the notebook using the OneNote native client app if it's installed. The value of oneNoteWebURL can be used to open the web-browser based OneNote Online client.

self: string

The endpoint where you can get details about the notebook.

id: string

The unique identifier of the notebook.

name: string

The name of the notebook.

createdBy: string

The user who created the notebook.

createdTime: An ISO 8601 formatted date

The date and time when the notebook was created.

lastModifiedBy: string

The user who last modified the notebook.

lastModifiedTime: An ISO 8601 formatted date

The date and time when the notebook was last modified.

Example
{
  "createdBy": "user name",
  "createdTime": "2013-10-05T10:57:00.683Z",
  "id": "notebook ID",
  "isDefault": false,
  "isShared": false,
  "lastModifiedBy": "user name",
  "lastModifiedTime": "2014-01-28T18:49:00.47Z",
  "links": {
	"oneNoteClientUrl": {
	  "href": "onenote:https://{client URL}"
	},
	"oneNoteWebUrl": {
	  "href": "https://{web URL}"
	}
  },
  "name": "notebook name",
  "sectionGroupsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sectionGroups",
  "sectionsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sections",
  "self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}",
  "userRole": "Contributor"
}

Section:

isDefault: Boolean

Indicates whether this is the user’s default section.

pagesUrl: string

The /pages endpoint where you can get details for all the pages in the section.

self: string

The endpoint where you can get details about the section.

id: string

The unique identifier of the section.

parentNotebook: Notebook

The notebook that contains the section, expanded by default with the id, name, and self properties selected.

parentSectionGroup: SectionGroup

The section group that contains the section, expanded by default with the id, name, and self properties selected.

name: string

The name of the section.

createdBy: string

The user who created the section.

createdTime: An ISO 8601 formatted date

The date and time when the notebook was created.

lastModifiedBy: string

The user who last modified the section.

lastModifiedTime: An ISO 8601 formatted date

The date and time when the section was last modified.

Example
{
  "createdBy": "name",
  "createdTime": "2014-09-09T21:52:12.773Z",
  "id": "{section ID}",
  "isDefault": false,
  "lastModifiedBy": "name",
  "lastModifiedTime": "2014-09-09T21:52:42.29Z",
  "name": "sectionname",
  "pagesUrl": "https://www.onenote.com/api/v1.0/sections/{section ID}/pages",
  "parentNotebook": {
	"id": "notebook ID",
	"name": "notebook name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}"
  },
  "parentSectionGroup": {
	"id": "section group ID",
	"name": "section group name",
	"self": "https://www.onenote.com/api/v1.0/notebooks/{section group ID}"
  },
  "self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
}

Page:

content: Stream

The page's HTML content.

contentUrl: string

The URL for the page's HTML content.

createdByAppId: string 0000000048118631 (OneNote Client), 000000004C1143C3 (Office Lens), 000000004C115108 (me@onenote.com), 000000004C1143C4 (OneNote Clipper)

The unique identifier of the application that created the page.

level: Int32

The indentation level of the page. To get page level and order, include pagelevel=true in your queries for pages in a section or for a specific page.

links: object

The oneNoteClientURL link to open the page in the OneNote native client if it's installed, and oneNoteWebURL to open the page in OneNote Online.

order: Int32

The order of the page within its parent section. To get page level and order, include pagelevel=true in your queries for pages in a section or for a specific page.

parentNotebook: Notebook

The notebook that contains the page.

parentSection: Section

The section that contains the page, expanded by default with the id, name, and self properties selected.

self: string

The URL for the page's metadata.

title: string

The title of the page.

id: string

The unique identifier of the page.

createdTime: An ISO 8601 formatted date

The date and time when the page was created.

lastModifiedTime: An ISO 8601 formatted date

The date and time when the page was last modified.

Example
{
  "contentUrl": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}/content",
  "createdByAppId": "WLID-0000000038118631",
  "createdTime": "2013-05-27T17:53:24.158Z",
  "id": "{page ID}!{section ID}",
  "lastModifiedTime": "2015-02-05T21:01:39.18Z",
  "links": {
	"oneNoteClientUrl": {
	  "href": "onenote:https://{client URL}"
	},
	"oneNoteWebUrl": {
	  "href": "https://{web URL}"
	}
  },
  "parentSection": {
	"id": "{section ID}",
	"name": "Quick Notes",
	"self": "https://www.onenote.com/api/v1.0/sections/{section ID}"
  },
  "parentSection@odata.context": "https://www.onenote.com:576/api/v1.0/$metadata#me/notes/pages('{page ID}!{section ID}')/parentSection(id,name,self)/$entity",
  "self": "https://www.onenote.com/api/v1.0/pages/{page ID}!{section ID}",
  "title": "Bike Carriers for Car"
}

SectionGroup:

parentNotebook: Notebook

The notebook that contains the section group, expanded by default with the id, name, and self properties selected.

parentSectionGroup: Section

The section group that contains the section group, expanded by default with the id, name, and self properties selected.

sectionGroups: Collection(SectionGroup)

The section groups in the section group. Can be navigated to using the sectionGroupsUrl property or expanded in a GET request.

sectionGroupsUrl: string

The URL for the sectionGroups navigation property, which returns all the section groups in the section group.

sections: Collection(Section)

The sections in the section group. Can be navigated to using the sectionsUrl property or expanded in a GET request.

sectionsUrl: string

The URL for the sections` navigation property, which returns all the sections in the section group.

self: string

The endpoint where you can get details about the section group.

id: string

The unique identifier of the section group.

name: string

The name of the section group.

createdBy: string

The user who created the section group.

createdTime: An ISO 8601 formatted date

The date and time when the section group was created.

lastModifiedBy: string

The user who last modified the section group.

lastModifiedTime: An ISO 8601 formatted date

The date and time when the section group was last modified.

Example
{
  "createdBy": "username",
  "createdTime": "2015-06-03T21:31:56.513Z",
  "id": "{section group ID}",
  "lastModifiedBy": "username",
  "lastModifiedTime": "2015-06-03T21:31:56.513Z",
  "name": "My Section Group Name",
  "sectionGroupsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sectionGroups",
  "sectionsUrl": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}/sections",
  "self": "https://www.onenote.com/api/beta/me/notes/sectionGroups/{section group ID}"
}
;