[GraphAPI][Excel][SharePoint] "Get Range" endpoint not working fully

Filip 41 Reputation points
2022-08-09T08:26:23.233+00:00

Hello, in the documentation it it stated that the "Get Range" endpoint can have these forms:

  1. GET /me/drive/items/{id}/workbook/worksheets/{id|name}/range(address='ADDRESS')
  2. GET /me/drive/root:/{item-path}:/workbook/worksheets/{id|name}/range(address='ADDRESS')

We have been using the 2nd endpoint form for at least month and now, all of a sudden, this form of the endpoint stopped working. Now it just returns the generic (and useless error) "Access denied - Could not obtain a WAC access token". We have verified that this is reproducible both while using the Graph Explorer and our App-registration/Enterprise-app.

Here's the error when trying to use the Graph Explorer:
image

The endpoint here used here is of the 2nd form ({drive-specifier}/root:/{item-path}:/workbook/worksheets/{name}/range(address='ADDRESS'):
https://graph.microsoft.com/v1.0/drives/b!8t9_56QYkUWts3Vh8Go_m1_e09d0pRtMkY_uyqaB-28fXJxUuL6kQp_WN09i_627/root:/accounts/8226a395-3b22-468a-968c-48386bfa6779/8226a395-3b22-468a-968c-48386bfa6779.xlsx:/workbook/worksheets/Sheet1/range(address='D5:E5'))

And here's the success message when using the 1nd endpoint form on the same file:
image

The only difference between these 2 is that in the 2nd we are using the ID of the file instead of it's path:
https://graph.microsoft.com/v1.0/drives/b!8t9_56QYkUWts3Vh8Go_m1_e09d0pRtMkY_uyqaB-28fXJxUuL6kQp_WN09i_627/items/01N7FLUJFO3T3ECD4QGZEKVUBDNIEZECEU/workbook/worksheets/Sheet1/range(address='D5:E5')

In case you think that we might have just misspelled the path of the file, here's the verification that we did not and that the filepath "root:/accounts/8226a395-3b22-468a-968c-48386bfa6779/8226a395-3b22-468a-968c-48386bfa6779.xlsx" indeed corresponds to the file-ID "01N7FLUJFO3T3ECD4QGZEKVUBDNIEZECEU":
image

As such we would like to know if this will get fixed or if this endpoint form is getting deprecated?

Btw, interestingly enough the 2nd endpoint form, which fails, works if you use the SharePoint site-id instead of the drive-id.
image

To be more precise, if you take the 2nd endpoint form:
{drive-specifier}/root:/{item-path}:/workbook/worksheets/{name}/range(address='ADDRESS')
and modify it into:
{sharepoint-site-id}/drive/root:/{item-path}:/workbook/worksheets/{name}/range(address='ADDRESS')

In our concrete case, you take:
https://graph.microsoft.com/v1.0/drives/b!8t9_56QYkUWts3Vh8Go_m1_e09d0pRtMkY_uyqaB-28fXJxUuL6kQp_WN09i_627/root:/accounts/8226a395-3b22-468a-968c-48386bfa6779/8226a395-3b22-468a-968c-48386bfa6779.xlsx:/workbook/worksheets/Sheet1/range(address='D5:E5')
and change the first part into:
https://graph.microsoft.com/v1.0/sites/adnexcel.sharepoint.com,e77fdff2-18a4-4591-adb3-7561f06a3f9b,d7d3de5f-a574-4c1b-918f-eecaa681fb6f/drive/root:/accounts/8226a395-3b22-468a-968c-48386bfa6779/8226a395-3b22-468a-968c-48386bfa6779.xlsx:/workbook/worksheets/Sheet1/range(address='D5:E5')

Then it works...

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,538 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,660 questions
{count} votes

Accepted answer
  1. Shivam Dhiman 5,946 Reputation points
    2022-08-12T16:27:13.777+00:00

    Hi @Filip

    I am able to replicate this issue. 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 http://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 additional answers

Sort by: Most helpful