Searching for a file using a specific sha1hash in onedrive via graph api

Marc Rosenbaum 96 Reputation points
2021-01-22T00:08:36.077+00:00

Hi everyone,
I am looking for a way to search a file with a specific sha1 hash. Is it possible to search the metadata of a file in onedrive? This would be great to look for duplicates before uploading the file.

I would be thankful for every useful hint.

Greetings Marc

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,582 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Diya Ahuja 5 Reputation points
    2023-06-30T18:10:55.89+00:00

    Yes, it is possible to search the metadata of a file in OneDrive. You can use the /drives/{drive-id}/root/search(q='{search-query}') endpoint to search for files with a specific SHA1 hash. You can also use the $expand, $select, $skipToken, $top, and $orderby OData query parameters to customize the response. For more information, please refer to the Microsoft Graph documentation.

    0 comments No comments