Update page

Update the content of a OneNote page.

Prerequisites

One of the following scopes is required to execute this API:
Notes.ReadWrite.CreatedByApp, Notes.ReadWrite, or Notes.ReadWrite.All

HTTP request

PATCH /me/notes/pages/{id}/content
PATCH /users/{id | userPrincipalName}/notes/pages/{id}/content
PATCH /groups/{id}/notes/pages/{id}/content

Request headers

Name Type Description
Authorization string Bearer <token> A valid OAuth token provided to the app based on the user credentials and the user having authorized access.
Content-Type string application/json

Request body

In the request body, supply an array of patchContentCommand objects that represent the changes to the page. For more information and examples, see Update OneNote pages.

Response

If successful, this method returns a 204 No Content response code. No JSON data is returned for a PATCH request.

Example

Request

Here is an example of the request.

PATCH https://graph.microsoft.com/beta/me/notes/pages/{id}/content
Content-type: application/json
Content-length: 312

[
   {
    'target':'#para-id',
    'action':'insert',
    'position':'before',
    'content':'<img src="image-url-or-part-name" alt="image-alt-text" />'
  }, 
  {
    'target':'#list-id',
    'action':'append',
    'content':'<li>new-page-content</li>'
  }
]
Response

Here is an example of the response.

HTTP/1.1 204 No Content