how do i find a file id?

PROMCT 0 Reputation points
2025-11-26T14:31:45.7966667+00:00

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
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. PROMCT 0 Reputation points
    2025-11-26T14:40:53.9366667+00:00

    None of the options work for me, or at least that I could get working.

    0 comments No comments

  2. 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.Read or Files.ReadWrite (minimum).
    • Application (client credentials): Files.Read.All or Files.ReadWrite.All, and make sure Admin consent is granted.

    https://graph.microsoft.com/v1.0/me/drive/items/root/children?$select=id,name

    User's image

    https://graph.microsoft.com/v1.0/me/drive/root/children?$select=id,name

    User's image

    /me/drive/items/root/children uses 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/children uses 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/drive or /me/drive/root/children. Reference: Get Drive

    User's image

    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.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.