Microsoft OneDrive (Graph)
Integrates with Microsoft OneDrive using the Microsoft Graph API, allowing automation of common file and folder operations in OneDrive and SharePoint document libraries.
Revision History
1.0.0.0 Initial Release
Properties
Connection
Type: Connection Input
TenantId
Type: String
The Directory (tenant) ID associated with your Microsoft Entra application.
ClientId
Type: String
The Application (client) ID as registered in Microsoft Entra.
ClientSecret
Type: Password
The client secret value generated in Microsoft Entra. This value is only shown once when generated.
AccessToken
Type: Password
OAuth access token for Microsoft Graph API. Used for authentication.
RefreshToken
Type: Password
OAuth refresh token used to obtain new access tokens.
Operation
Type: List Input
ListDrives
GetDrive
ListItems
CreateFolder
DownloadItem
UploadItem
RenameItem
The operation that will be executed against the OneDrive or SharePoint drive.
DriveId
Type: String Input
The ID of the OneDrive or SharePoint drive. Required for all operations except ListDrives
.
ItemPath
Type: String Input
The path to the folder or file, relative to the root of the drive. Should start with /
. Used in all operations except ListDrives
and GetDrive
.
File
Type: Binary Input/Output
- Used as Input when uploading a file (
UploadItem
operation). - Used as Output when downloading a file (
DownloadItem
operation).
Result
Type: String Output
Contains the JSON response from Microsoft Graph for the executed operation.
Remarks
Authentication
To use this connector, register an application in Microsoft Entra (Azure AD) and configure it with appropriate Microsoft Graph API permissions such as Files.ReadWrite.All
or Sites.ReadWrite.All
. Generate a ClientId
, TenantId
, and ClientSecret
, and use them to obtain access and refresh tokens.
ItemPath Usage
The ItemPath
must begin with a forward slash (/
). For example:
/Documents/Reports/June.pdf
/Shared Documents/2024/ProjectPlan.docx
File Handling
When using the UploadItem
operation, set the File
property with the file content in binary format. When using DownloadItem
, the File
output will contain the downloaded file content.
Example Scenarios
- To upload a report to a folder: use
UploadItem
, setDriveId
,ItemPath
, and provide binaryFile
input. - To list all items in a folder: use
ListItems
withDriveId
andItemPath
. - To rename a document: use
RenameItem
withDriveId
,ItemPath
, and setName
in the extended implementation (if applicable).
Microsoft Graph API Reference
Refer to the official documentation for further details on the endpoints used:
https://learn.microsoft.com/en-us/graph/api/resources/onedrive