Issue with Graph API PATCH Request to Update Excel Range: HTTP 405 Error

Jagapathi Seemakurthy 0 Reputation points
2025-04-02T07:14:04.2566667+00:00

We are encountering an issue when attempting to update a range in an Excel worksheet using the Microsoft Graph API. The request fails with the following error:

405 - HTTP verb used to access this page is not allowed.

Request Details:

  • URL:https://graph.microsoft.com/v1.0/me/drive/items/01BQLIGHUFYSJCUP7JRNGIIWTK4EN77TIG/workbook/worksheets/%7B37CC9684-A622-4277-9481-105A62D56E47%7D/range(address='A32003:H34002')
  • Method: PATCH
  • Headers:
    • Authorization: Bearer ********
      • Content-Type: application/json
        • Accept: application/json
        • Body: (trimmed for brevity)

Observations:

  1. The error suggests that the HTTP verb (PATCH) is not allowed.
  2. We suspect there might be a redirect happening during the call, as we see the following URL in the logs:
    https://pus13-excel.officeapps.live.com/x/_layouts/xlrestinternal.aspx?ui=en-US&rs=en-US&WOPISrc=https%3a%2f%2f{{domain}}.sharepoint.com%2fpersonal%2f{{user-id}}%2f_vti_bin%2fwopi.ashx%2ffiles%2f92c60b80b9814e66960f6ea3571decab&wdEnableRoaming=1&mscc=1&wdODB=1&hid=8d6f90a1-20c3-4000-e90b-e480f15ecfcb&wdRestPart=_api%2fworksheets(%27%257B37CC9684-A622-4277-9481-105A62D56E47%257D%27)%2frange(address%3d%27A32003%3aH34002%27)
  3. This issue does not happen every time. We write data in batches of 1000 rows, and while most batches succeed, one of the batches occasionally fails with this error.

Questions:

  1. Is there a known issue with PATCH Requests for updating Excel ranges via the Graph API?
  2. Could the redirect to the pus13-excel.officeapps.live.com domain be causing the issue? If so, how can we handle this?
  3. Are there any additional configurations or headers required to ensure the request is processed correctly?
  4. Could this be related to inconsistencies when processing large batches?

Any guidance or suggestions to resolve this issue would be greatly appreciated. Thank you!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,489 questions
{count} votes

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.