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

Prakash Verma 55 Reputation points
2023-09-18T13:48:54.0466667+00:00

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}'

Response:

StatusCode: 504 Gateway Timeout 
{
	"error": {
		"code":"UnknownError",
		"message":"",
		"innerError": {
			"date":"2023-09-14T18:38:48",
			"request-id":"4d55fec3-5802-40c7-a3cf-e0a3a3e90a57",
			"client-request-id":"fd268860-6ae3-4e03-9512-25cf0d518eda"
		}
	}
}

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.
11,268 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.
174 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 39,736 Reputation points
    2023-09-19T10:23:52.1866667+00:00

    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