Dear @VANBESIEN, MAXENCE,
Thank you for reaching out to the Microsoft Q&A Community.
From my research, the ODataError: The resource could not be found message you're seeing is puzzling, especially since your admin confirmed full access. This error can occur for several reasons and may be related to how the API is configured to interact with your site's content. Your observation about the "Classic Experience" mode is a very interesting lead.
Here are some areas we can investigate to help diagnose and resolve this issue.
Permissions and Scopes
Even though your admin team confirmed you have access to the full drive, the Graph API requires specific permissions (scopes) that might not be correctly configured for your application.
To read drive items, your application needs the Sites.Read.All or Files.Read.All permission. For sites with classic libraries, the Sites.Read.All permission is generally what you want. Confirm with your admin that your application's service principal or your user account has these exact permissions granted.
For reference: Microsoft Graph permissions reference - Microsoft Graph | Microsoft Learn
Potential API Endpoint Behavior
The drives() endpoint is designed to work seamlessly with modern SharePoint document libraries. However, it's possible that a site in "Classic Experience" mode may not expose its resources to the API in the same way.
As a diagnostic step, you could try using a more direct, SharePoint-specific API endpoint to access the library. This approach may help determine if the issue is with the drive's abstraction or with the resource itself.
Instead of /drives/{drive-id}/root, you could try a path like this:
[https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/drive/root]
To do this, you would first need to get the list-id of the document library. You can find this by retrieving a list of all lists for a given site.
For references:
Working with SharePoint sites in Microsoft Graph - Microsoft Graph v1.0 | Microsoft Learn
Get a SharePoint Site - Microsoft Graph v1.0 | Microsoft Learn
You can find answer similar to your question here : How to Form URL to Fetch Items From a Sharepoint List via Graph API? - Stack Overflow (Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link)
If none of the above solutions work, let me know for further investigation. Please note that our initial response does not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution. Thank you for your patience and understanding.
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.
