Microsoft OneDrive (With Drive ID)

Consume Microsoft OneDrive API with custom Drive ID

File → Copy

AI-generated

Summary

Copy a file in Microsoft OneDrive to a specified location, optionally renaming the copy.

Inputs

  • File ID (required) — The unique identifier of the file to copy.
  • Parent Reference — Reference details specifying the destination folder or location for the copied file, including optional Drive ID, Drive Type, item ID, list ID, name, path, share ID, and site ID.
  • Name — The new name to assign to the copied file; if not specified, the original file's name is used.

Output shape

a JSON object containing the 'location' header URL where the copy operation status can be tracked

The copy operation is asynchronous; the output includes a location URL to monitor or follow up on the copy's completion status.

Examples

Example 1: Copy a file and rename the copy to 'NewFileName.txt' in a specific folder identified by Drive ID and item ID

Set 'File ID' to the source file's ID, provide 'Parent Reference' with the target Drive ID and item ID, and set 'Name' to 'NewFileName.txt'.

Links

Discussion