The OneNote - Graph API does not return the new name of the Section after rename

Hieu Trung Phan 6 Reputation points
2022-10-27T09:17:13.303+00:00

Hi guys, I'm a developer working with OneNote through the Graph API. I got a problem with the Section name. I created a section called Section 1 and call the Graph API to get all the sections, the result contains Section 1. But if I rename Section 1 to Section A, and call the Graph API again, the result still returns Section 1 instead of Section A

Microsoft Security Microsoft Graph
{count} vote

2 answers

Sort by: Most helpful
  1. RajeshKumarMSFT 1,976 Reputation points Microsoft External Staff
    2022-10-27T13:30:58.587+00:00

    Hi @Hieu Trung Phan ,

    Hope you are doing well,

    I am able to get the updated one note section displayname using Graph API Patch method. Find the details below

    • Initially get all sections from the one note - Get - https://graph.microsoft.com/v1.0/me/onenote/sections
    • Get the section id from the above response for which we are going to update the display name
    • Update the display name using below endpoint with Patch operation Patch :https://graph.microsoft.com/v1.0/me/onenote/sections/Section ID
      Request Body
      {
      "displayName": "New sectionName"
      }

    254727-image.png

    • Once the operation is completed you can check the updated section details.

    Refer this link for more details
    Hope this helps.
    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.


  2. Hieu Trung Phan 6 Reputation points
    2022-11-23T04:07:10.14+00:00

    Hi @RajeshKumarMSFT ,
    My job is to get the section name from the notebook of other people, and the section was renamed by them, not me :(

    0 comments No comments

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.