FileOpenUserUnauthorized - Cannot access my own files on Graph

Echologr 0 Reputation points
2024-06-23T20:11:01.2+00:00

I am trying to access an Excel workbook in my drives root through the Microsoft Graph Explorer. I can access the DriveItem by using:

https://graph.microsoft.com/v1.0/me/drive/items/{id}/

and see myself as the owner of the file, but when I use:

https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/worksheets

I get the "FileOpenUserUnauthorized" error. How can that be?

Screenshot 2024-06-23 at 21.52

Thanks for your help!

Echologr

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,173 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 1,405 Reputation points Microsoft Vendor
    2024-06-24T02:58:41.71+00:00

    Hi @Echologr

    According to the Graph API documentation, the required permission to access the /workbook/worksheets endpoint is Files.ReadWrite, grant that permission in Graph Explorer.

    User's image

    My test results are as follows:

    Screenshot 2024-06-24 105708

    Hope this helps.

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