79557184

Date: 2025-04-05 15:43:57
Score: 0.5
Natty:
Report link

@thewildman97 Use GET /drives/{driveId}/items/{uniqueId}

If you already have the file’s unique ID (a DriveItem ID or SharePoint file ID), then:

GET https://graph.microsoft.com/v1.0/sites/{siteId}/drive/items/{uniqueId}

Or, better yet, if you want to use the path (e.g., serverRelativePath or serverRelativeUrl), you can:

Use the path-based drive/root: endpoint

GET https://graph.microsoft.com/v1.0/sites/{siteId}/drive/root:{serverRelativePath}

Example:-

GET https://graph.microsoft.com/v1.0/sites/{siteId}/drive/root:/Shared Documents/ExampleFolder/movie.mp4

This is often more reliable when dealing with paths you already parsed from serverRelativeUrl or file.

It avoids ambiguity with GUID vs. item ID mismatches.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Use
  • Low reputation (0.5):
Posted by: microsoftdeveloperdesigner