How can we update a one note page and add PDF file content as images?

dipti mittal 0 Reputation points
2023-07-31T06:07:05.1933333+00:00

Hi,

Working on a requirement where we have to update already created one note page with PDF file content as images.

https://learn.microsoft.com/en-us/graph/onenote-update-page.

Is it possible using MS graph API with patch call?

Microsoft 365 and Office | Development | Other
Microsoft Security | Microsoft Graph
Microsoft 365 and Office | OneNote | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. msft-gu 1,355 Reputation points
    2023-07-31T18:23:20.8833333+00:00

    Hi @dipti mittal

    Good afternoon and thank you for your question. On the article just below Update OneNote page, namely Add images, videos, and files it states that:

    Applies to Consumer notebooks on OneDrive | Enterprise notebooks on Microsoft 365

    You can use img, object, and iframe elements to add images, videos, and files to a OneNote page when you're creating or updating the page.

    • Use img to render an image on the page.
    • Use iframe to embed a video on the page.
    • Use object to add a file attachment to the page.

    Under the same article, there was a sample titled: Add images of PDF file contents

    https://learn.microsoft.com/en-us/graph/onenote-images-files#add-images-of-pdf-file-contents

    To add, the update endpoint is :

    To update the content of a OneNote page, you send a PATCH request to the page's content endpoint:

    PATCH ../notes/pages/{id}/content

    Send a JSON change object in the message body. If the request is successful, Microsoft Graph returns a 204 HTTP status code.

    Reference: https://learn.microsoft.com/en-us/graph/onenote-update-page

    If I answered your question, please upvote it and accept it as an answer. Thank you and have a great day!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.