How can I get predictable results when calling OneNote Graph API?

Mark Ward 20 Reputation points
2023-03-26T19:53:29.6466667+00:00

I am reading a list of notes from a section. Today, I moved several pages to a different section. When I called the API to list the pages for the section, it showed pages from 2021 combined with the remaining pages. The pages from 2021 are stored in a different section than the one I am querying.

When I view the section in OneNote it should only contain 4 pages. When I am accessing the section via Microsoft Graph I am getting these 4 pages and an additional 16 pages. These additional pages are not in this section but are located in a different section. The Graph API is returning an inconsistent state for this section.

The query for the pages is using a section pages endpoint. The results given contain pages in this section and 16 additional pages that exist in another section or were deleted. All of the additional pages are close to their creation date, around October 2021. The section queried is expected to return 4 pages created in 2023.

OneNote
OneNote
A family of Microsoft products that enable users to capture, organize, and reuse notes electronically.
192 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,866 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Gopinath Chennamadhavuni 2,436 Reputation points
    2023-03-29T10:58:16.33+00:00

    Hi @Mark Ward,

    Thanks for reaching out.  

    I am able to replicate this issue in my test tenant. As per my analysis, there is delay reflecting the changes from OneNote UI to Graph API response as it relies on indexing service in the backend. 

    Can you check the same Graph API response after few minutes the change from OneNote UI?

    If you are still facing the same issue with some delay, I would recommend you to raise a support case with Microsoft Graph, a Support Engineer will be able to assist you better. You can raise support ticket from https://aad.portal.azure.com/ or https://admin.microsoft.com/#/support/requests.

    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.

    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.