Fetching OneNote Section Returns 504 Gateway Timeout Error All The Time via Microsoft Graph API

Prakash Verma 5 Reputation points

We are using Microsoft Graph API List sections to get list of sections from the specified notebook. But this API keeps failing with 504 Gateway Timeout error for some groups for our customer.

Endpoint: GET https://graph.microsoft.com/v1.0/groups/{groupId}/onenote/notebooks/{notebookId}/sections?$filter=displayName eq '{sectionName}'


StatusCode: 504 Gateway Timeout 
	"error": {
		"innerError": {

Could you please look into this matter and resolve this issue asap so that we can serve our customer in a best possible manner?

Thanks in anticipation.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
2,068 questions
Microsoft Graph Notes API
Microsoft Graph Notes API
A Microsoft API that lets your app get authorized access to a user's OneNote notebooks, sections, and pages in a personal or organization account.
53 questions
OneNote Management
OneNote Management
OneNote: A family of Microsoft products that enable users to capture, organize, and reuse notes electronically.Management: The act or process of organizing, handling, directing or controlling something.
149 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 28,281 Reputation points

    Hi @Prakash Verma

    I've noticed that recently some users have reported the OneNote API returning a 504 Gateway Timeout error. This could be caused by various factors, such as network issues, server overload, or request complexity.

    One possible solution is to reduce the requested page size. For example, using the $top query parameter to specify the maximum number of items to return per page, which paginates the result set to reduce the workload.

    Another possible solution is to retry the request after a certain interval. Sometimes, the 504 error is temporary and can be resolved by resubmitting the request. You could implement a retry logic in your code that checks for the 504 error and waits for a few seconds before trying again.

    If the above suggestions don't work, then please open a support ticket on this to get help from the Microsoft support team.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments