Lodol Docs

Microsoft OneDrive

API actions for the Microsoft OneDrive integration.

Microsoft OneDrive

Store, move, and share files with Microsoft OneDrive.


Create folder

Create a new folder in OneDrive.

Parameters

ParameterTypeRequiredDescription
folder_namestringYesName for the new folder.
parent_item_idstringNoID of the folder to create the new folder inside.
drive_idstringYesID of the drive to use. You can find drive IDs with the List drives action.

Response

{
  "id": "folder123",
  "name": "NewFolder"
}

Create a sharing link for a file or folder.

Parameters

ParameterTypeRequiredDescription
item_idstringYesID of the file or folder to share.
link_typestringYesType of link to create (view or edit).
drive_idstringYesID of the drive to use. You can find drive IDs with the List drives action.

Response

{
  "link": {
    "webUrl": "https://..."
  }
}

Create workbook

Create a new blank Excel workbook (.xlsx) in OneDrive.

Parameters

ParameterTypeRequiredDescription
workbook_namestringYesName for the new workbook (e.g. 'Q3 Sales'). .xlsx extension added automatically if missing.
parent_item_idstringNoID of the folder to create the workbook in.
drive_idstringYesID of the drive to use. You can find drive IDs with the List drives action.

Response

{
  "id": "workbook123",
  "name": "Q3 Sales.xlsx",
  "webUrl": "https://..."
}

Delete file or folder

Delete a file or folder from OneDrive.

Parameters

ParameterTypeRequiredDescription
item_idstringYesID of the file or folder to delete.
drive_idstringYesID of the drive to use. You can find drive IDs with the List drives action.

Response

{
  "deleted": true
}

List folder contents

List the contents of a folder in OneDrive.

Parameters

ParameterTypeRequiredDescription
parent_item_idstringNoID of the folder to list.
drive_idstringYesID of the drive to use. You can find drive IDs with the List drives action.

Response

{
  "value": [
    {
      "id": "item1",
      "name": "file1.txt"
    }
  ]
}

List drives

List the drives available on a SharePoint site (uses the main site unless you specify one).

Parameters

ParameterTypeRequiredDescription
site_idstringNoSharePoint site ID. Leave blank to use the main site (defaults to 'root').

Response

{
  "value": [
    {
      "driveType": "documentLibrary",
      "id": "drive1",
      "name": "Documents"
    }
  ]
}

Move file or folder

Move a file or folder to a new location in OneDrive.

Parameters

ParameterTypeRequiredDescription
item_idstringYesID of the file or folder to move.
destination_parent_idstringYesID of the folder to move it into.
drive_idstringYesID of the drive to use. You can find drive IDs with the List drives action.

Response

{
  "id": "item123",
  "name": "movedItem"
}

Look up a Microsoft sharing link to get the drive ID and item ID of the shared file or folder.

Parameters

ParameterTypeRequiredDescription
share_urlstringYesMicrosoft sharing URL (e.g., from SharePoint or OneDrive).

Response

{
  "drive_id": "drive456",
  "item_id": "item123",
  "name": "Project Tracker.xlsx",
  "web_url": "https://..."
}

Upload file

Upload a file to OneDrive.

Parameters

ParameterTypeRequiredDescription
file_pathstringYesThe file to upload to OneDrive.
parent_item_idstringNoID of the folder to upload the file into.
drive_idstringYesID of the drive to use. You can find drive IDs with the List drives action.
conflict_behaviorstringNoWhat to do if a file with the same name already exists: rename, replace, or fail.

Response

{
  "id": "item123",
  "name": "file.txt",
  "webUrl": "https://..."
}

On this page