None of the options work for me, or at least that I could get working.
how do i find a file id?
I'm trying to get a file id so I use it a 3rd party integration system (Zapier) to find and update a file. In my research, it appears this cannot be done in OneDrive, but I can do it Graph Explorer. When I submit the GET command (https://graph.microsoft.com/v1.0/me/drive/items/root/children?$select=id,name), I get a 404 error with the response below. Any thoughts?
{
"error": {
"code": "itemNotFound",
"message": "Item not found",
"innerError": {
"date": "2025-11-26T14:27:20",
"request-id": "<PII: moderator removed>",
"client-request-id": "<PII: moderator removed>"
}
}
}
Microsoft 365 and Office | Development | Other
2 answers
Sort by: Most helpful
-
-
TiNo-T 8,915 Reputation points Microsoft External Staff Moderator
2025-11-27T00:49:26.7433333+00:00 Please understand that our forum is a public platform, and we will modify your question to cover your personal information in the description. Kindly ensure that you hide these personal or organization information next time you post error or some information to protect personal data.
Dear @PROMCT
Welcome to Microsoft Q&A Forum!
Thanks for sharing the details. I ran two tests using your exact endpoint and a variant without “items”, both returned OK and listed file IDs:
Note: Please make sure that you added a permissions checklist the recipient should verify before retrying:
- Delegated (/me/…):
Files.ReadorFiles.ReadWrite(minimum). - Application (client credentials):
Files.Read.AllorFiles.ReadWrite.All, and make sure Admin consent is granted.
•
https://graph.microsoft.com/v1.0/me/drive/items/root/children?$select=id,name•
https://graph.microsoft.com/v1.0/me/drive/root/children?$select=id,name/me/drive/items/root/childrenuses the items-by-ID pattern, where root is a well-known alias for the root driveItem, then lists that item’s children.
/me/drive/root/childrenuses the relationship from the Drive to its root container, then lists that item’s children.In practice, both return the same set of children (files/folders at the OneDrive root) when permissions and provisioning are OK. The first form is the one shown in Microsoft Learn examples and is preferred for clarity.
References:
Therefore, when your call still returns 404 and
itemNotFound, the reasons may cause it:- OneDrive has not provisioned for the user yet. Please have them open OneDrive on the web once, then retry
/me/driveor/me/drive/root/children. Reference: Get Drive
- Auth flow mismatch. If you’re using an app‑only (client credentials) token, switch to
/users/{userPrincipalName}/drive/... instead of/me/...; or test with a delegated user token in Graph Explorer. Check more details in Get Drive article above. - Wrong store. If the target file is in SharePoint/Teams (not personal OneDrive), use
/sites/{siteId}/drive/root:/(e.g., “Shared Documents/…”). References:
Please note that our support is limited to providing guidance based on official Microsoft documentation. Any third-party resources or references shared are intended solely for informational or consultative purposes. Microsoft does not guarantee the accuracy, reliability, or continued availability of third-party content, and we recommend exercising discretion when referring to such materials.
I hope this information can give you more insights. Wish you a pleasant day!
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.
- Delegated (/me/…):