Skip to content

Latest commit

 

History

History
103 lines (86 loc) · 3.19 KB

File metadata and controls

103 lines (86 loc) · 3.19 KB
title Update page
description Update the content of a OneNote page.
ms.localizationpriority medium
author jewan-microsoft
ms.subservice onenote
doc_type apiPageType
ms.date 06/22/2024

Update page

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Update the content of a OneNote page.

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

HTTP request

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

Request headers

Name Type Description
Authorization string Bearer {token}. Required. Learn more about authentication and authorization.
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 page content.

Response

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

Example

Request

The following example shows a request.

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

[
   {
    '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>'
  }
]

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


Response

The following example shows the response.

HTTP/1.1 204 No Content