capabilities.work

Discover and Download a OneDrive File

A 4-step recipe with Microsoft Office. We can help you get access.

Recipe · 4 steps

Discover and Download a OneDrive File

Locate a file in the OneDrive root by name and download its content.

  1. Resolve the signed-in user's OneDrive to confirm access and capture the drive id, type, and remaining quota before transferring any content.
  2. List the items in the root of the drive so the caller can resolve a target file by name when only a human-readable name is known.
  3. Read the target driveItem's metadata to confirm it exists and carries a file facet, which distinguishes a downloadable file from a folder.
  4. Download the file's content. Graph either redirects to a short-lived pre-authenticated download URL or streams the bytes directly, so both a 302 and a 200 are accepted as success.
What you'll need to have ready
  • itemId: The driveItem id to download. Resolve it from the root listing returned by the browseRoot step when it is not known ahead of time.
For your developer

Arazzo workflow microsoft-office:drive-file-discovery-download, 4 operations: getMyDrive → listMyDriveRootChildren → getMyDriveItem → downloadMyDriveItemContent. Specs on APIs.io.