Microsoft OneDrive
Microsoft OneDrive is a cloud storage service provided by Microsoft for storing, accessing, and sharing files online.
Categories: File Storage
Type: microsoftOneDrive/v1
Connections
Version: 1
OAuth2 Authorization Code
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| clientId | Client Id | STRING | true | |
| clientSecret | Client Secret | STRING | true | |
| tenantId | Tenant Id | STRING | true |
Connection Setup
Create OAuth 2.0 Application
Creation of OAuth 2.0 application is documented here.
Grant Necessary Permissions
- Open the Azure Portal: https://portal.azure.com/
- Click on App registrations.
- Click on All applications.
- Click on application you want to connect to Microsoft OneDrive.
- Click on API permissions.
- Click on Microsoft Graph (1).
- Select following scopes:
- Files.ReadWrite
- offline_access
- After selecting all the scopes click on Update permissions
Actions
Copy File
Name: copyFile
Copy a selected file to a different location within Microsoft OneDrive.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| id | File ID | STRING | ID of the file to copy. | true |
| name | New File Name | STRING | The new name for the copy. If this isn't provided, the same name will be used as the original. | false |
| parentId | Destination Folder ID | STRING | The ID of the folder where the copied file will be stored. If not specified, the root folder will be used. | false |
Example JSON Structure
{
"label" : "Copy File",
"name" : "copyFile",
"parameters" : {
"id" : "",
"name" : "",
"parentId" : ""
},
"type" : "microsoftOneDrive/v1/copyFile"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| @odata.context | STRING | |
| id | STRING | ID of the copied file. |
| createdDateTime | STRING | The date and time when the copied file was created. |
| lastActionDateTime | STRING | |
| percentageComplete | INTEGER | Percentage completion of the copy operation. |
| resourceId | STRING | |
| resourceLocation | STRING | |
| status | STRING | Status of the copy operation. |
Output Example
{
"@odata.context" : "",
"id" : "",
"createdDateTime" : "",
"lastActionDateTime" : "",
"percentageComplete" : 1,
"resourceId" : "",
"resourceLocation" : "",
"status" : ""
}Find File ID
To find the File ID, click here.
Find Folder ID
To find the Folder ID, click here.
Create New Folder
Name: createNewFolder
Creates a new empty folder in Microsoft OneDrive.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| name | Folder Name | STRING | The name of the new folder. | true |
| parentId | Parent Folder ID | STRING | ID of the folder where the new folder will be created; if no folder is selected, the folder will be created in the root folder. | false |
Example JSON Structure
{
"label" : "Create New Folder",
"name" : "createNewFolder",
"parameters" : {
"name" : "",
"parentId" : ""
},
"type" : "microsoftOneDrive/v1/createNewFolder"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| createdDateTime | DATE_TIME | The date and time when the folder was created. |
| eTag | STRING | |
| id | STRING | ID of the folder. |
| lastModifiedDateTime | DATE_TIME | The date and time when the folder was last modified. |
| name | STRING | Name of the folder. |
| size | INTEGER | Size of the folder in bytes. |
| webUrl | STRING | URL to access the folder in a web browser. |
| createdBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| lastModifiedBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| folder | OBJECT Properties{INTEGER(childCount)} |
Output Example
{
"createdDateTime" : "2021-01-01T00:00:00",
"eTag" : "",
"id" : "",
"lastModifiedDateTime" : "2021-01-01T00:00:00",
"name" : "",
"size" : 1,
"webUrl" : "",
"createdBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"lastModifiedBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"folder" : {
"childCount" : 1
}
}Create New Text File
Name: createNewTextFile
Creates a new text file in Microsoft OneDrive.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| name | File Name | STRING | The name of the new text file. | true |
| text | Text | STRING | The text content to add to file. | true |
| mimeType | File Type | STRING Optionsplain/text, text/csv, text/xml | Select file type. | true |
| parentId | Parent Folder ID | STRING | ID of the folder where the file should be created; if no folder is selected, the file will be created in the root folder. | false |
Example JSON Structure
{
"label" : "Create New Text File",
"name" : "createNewTextFile",
"parameters" : {
"name" : "",
"text" : "",
"mimeType" : "",
"parentId" : ""
},
"type" : "microsoftOneDrive/v1/createNewTextFile"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| createdDateTime | DATE_TIME | The date and time when the file was created. |
| eTag | STRING | |
| id | STRING | ID of the file. |
| lastModifiedDateTime | DATE_TIME | The date and time when the file was last modified. |
| name | STRING | Name of the created file. |
| size | INTEGER | Size of the file in bytes. |
| webUrl | STRING | URL to access the file in a web browser. |
| createdBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| lastModifiedBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| file | OBJECT Properties{{STRING(quickXorHash)}(hashes), STRING(mimeType)} |
Output Example
{
"createdDateTime" : "2021-01-01T00:00:00",
"eTag" : "",
"id" : "",
"lastModifiedDateTime" : "2021-01-01T00:00:00",
"name" : "",
"size" : 1,
"webUrl" : "",
"createdBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"lastModifiedBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"file" : {
"hashes" : {
"quickXorHash" : ""
},
"mimeType" : ""
}
}Find Folder ID
To find the Folder ID, click here.
Delete File
Name: deleteFile
Delete a selected file from Microsoft One Drive.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| id | File ID | STRING | The id of a file to delete. | true |
Example JSON Structure
{
"label" : "Delete File",
"name" : "deleteFile",
"parameters" : {
"id" : ""
},
"type" : "microsoftOneDrive/v1/deleteFile"
}Output
This action does not produce any output.
Find File ID
To find the File ID, click here.
Download File
Name: downloadFile
Download a file from your Microsoft OneDrive.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| id | File ID | STRING | ID of the file to download. | true |
Example JSON Structure
{
"label" : "Download File",
"name" : "downloadFile",
"parameters" : {
"id" : ""
},
"type" : "microsoftOneDrive/v1/downloadFile"
}Output
Type: FILE_ENTRY
Properties
| Name | Type | Description |
|---|---|---|
| extension | STRING | |
| mimeType | STRING | |
| name | STRING | |
| url | STRING |
Output Example
{
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}Find File ID
To find the File ID, click here.
Get File
Name: getFile
Retrieve a specified file from your Microsoft OneDrive.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| id | File ID | STRING | ID of the file to retrieve. | true |
Example JSON Structure
{
"label" : "Get File",
"name" : "getFile",
"parameters" : {
"id" : ""
},
"type" : "microsoftOneDrive/v1/getFile"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| createdDateTime | DATE_TIME | The date and time when the file was created. |
| eTag | STRING | |
| id | STRING | ID of the file. |
| lastModifiedDateTime | DATE_TIME | The date and time when the file was last modified. |
| name | STRING | Name of the created file. |
| size | INTEGER | Size of the file in bytes. |
| webUrl | STRING | URL to access the file in a web browser. |
| createdBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| lastModifiedBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| file | OBJECT Properties{{STRING(quickXorHash)}(hashes), STRING(mimeType)} |
Output Example
{
"createdDateTime" : "2021-01-01T00:00:00",
"eTag" : "",
"id" : "",
"lastModifiedDateTime" : "2021-01-01T00:00:00",
"name" : "",
"size" : 1,
"webUrl" : "",
"createdBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"lastModifiedBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"file" : {
"hashes" : {
"quickXorHash" : ""
},
"mimeType" : ""
}
}Find File ID
To find the File ID, click here.
List Files
Name: listFiles
List files in a OneDrive folder.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| parentId | Parent Folder ID | STRING | ID of the folder from which you want to list files. If no folder is specified, the root folder will be used. | false |
Example JSON Structure
{
"label" : "List Files",
"name" : "listFiles",
"parameters" : {
"parentId" : ""
},
"type" : "microsoftOneDrive/v1/listFiles"
}Output
Type: ARRAY
Items Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| createdDateTime | DATE_TIME | The date and time when the file was created. |
| eTag | STRING | |
| id | STRING | ID of the file. |
| lastModifiedDateTime | DATE_TIME | The date and time when the file was last modified. |
| name | STRING | Name of the created file. |
| size | INTEGER | Size of the file in bytes. |
| webUrl | STRING | URL to access the file in a web browser. |
| createdBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| lastModifiedBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| file | OBJECT Properties{{STRING(quickXorHash)}(hashes), STRING(mimeType)} |
Output Example
[ {
"createdDateTime" : "2021-01-01T00:00:00",
"eTag" : "",
"id" : "",
"lastModifiedDateTime" : "2021-01-01T00:00:00",
"name" : "",
"size" : 1,
"webUrl" : "",
"createdBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"lastModifiedBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"file" : {
"hashes" : {
"quickXorHash" : ""
},
"mimeType" : ""
}
} ]Find Folder ID
To find the Folder ID, click here.
List Folders
Name: listFolders
List folders in a OneDrive folder.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| parentId | Parent Folder ID | STRING | ID of the Folder from which you want to list folders. If no folder is specified, the root folder will be used. | false |
Example JSON Structure
{
"label" : "List Folders",
"name" : "listFolders",
"parameters" : {
"parentId" : ""
},
"type" : "microsoftOneDrive/v1/listFolders"
}Output
Type: ARRAY
Items Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| createdDateTime | DATE_TIME | The date and time when the folder was created. |
| eTag | STRING | |
| id | STRING | ID of the folder. |
| lastModifiedDateTime | DATE_TIME | The date and time when the folder was last modified. |
| name | STRING | Name of the folder. |
| size | INTEGER | Size of the folder in bytes. |
| webUrl | STRING | URL to access the folder in a web browser. |
| createdBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| lastModifiedBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| folder | OBJECT Properties{INTEGER(childCount)} |
Output Example
[ {
"createdDateTime" : "2021-01-01T00:00:00",
"eTag" : "",
"id" : "",
"lastModifiedDateTime" : "2021-01-01T00:00:00",
"name" : "",
"size" : 1,
"webUrl" : "",
"createdBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"lastModifiedBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"folder" : {
"childCount" : 1
}
} ]Find Folder ID
To find the Folder ID, click here.
Upload File
Name: uploadFile
Upload a file to your Microsoft OneDrive.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| parentId | Parent Folder ID | STRING | ID of the Folder where the file should be uploaded; if no folder is selected, the file will be uploaded in the root folder. | false |
| file | File Entry | FILE_ENTRY | File to upload. | true |
Example JSON Structure
{
"label" : "Upload File",
"name" : "uploadFile",
"parameters" : {
"parentId" : "",
"file" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
},
"type" : "microsoftOneDrive/v1/uploadFile"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| createdDateTime | DATE_TIME | The date and time when the file was created. |
| eTag | STRING | |
| id | STRING | ID of the file. |
| lastModifiedDateTime | DATE_TIME | The date and time when the file was last modified. |
| name | STRING | Name of the created file. |
| size | INTEGER | Size of the file in bytes. |
| webUrl | STRING | URL to access the file in a web browser. |
| createdBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| lastModifiedBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| file | OBJECT Properties{{STRING(quickXorHash)}(hashes), STRING(mimeType)} |
Output Example
{
"createdDateTime" : "2021-01-01T00:00:00",
"eTag" : "",
"id" : "",
"lastModifiedDateTime" : "2021-01-01T00:00:00",
"name" : "",
"size" : 1,
"webUrl" : "",
"createdBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"lastModifiedBy" : {
"user" : {
"id" : "",
"displayName" : ""
}
},
"file" : {
"hashes" : {
"quickXorHash" : ""
},
"mimeType" : ""
}
}Find Folder ID
To find the Folder ID, click here.
Triggers
New File
Name: newFile
Triggers when file is uploaded to folder.
Type: POLLING
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| parentId | Parent Folder ID | STRING | ID of the folder to watch for new files. If no folder is specified, the root folder will be used. | false |
Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| createdDateTime | DATE_TIME | The date and time when the file was created. |
| eTag | STRING | |
| id | STRING | ID of the file. |
| lastModifiedDateTime | DATE_TIME | The date and time when the file was last modified. |
| name | STRING | Name of the created file. |
| size | INTEGER | Size of the file in bytes. |
| webUrl | STRING | URL to access the file in a web browser. |
| createdBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| lastModifiedBy | OBJECT Properties{{STRING(id), STRING(displayName)}(user)} | |
| file | OBJECT Properties{{STRING(quickXorHash)}(hashes), STRING(mimeType)} |
JSON Example
{
"label" : "New File",
"name" : "newFile",
"parameters" : {
"parentId" : ""
},
"type" : "microsoftOneDrive/v1/newFile"
}What to do if your action is not listed here?
If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.
To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.
Additional Instructions
How to find File ID
The best way to find a file ID is to use the output of one of the Microsoft OneDrive actions or triggers. In the output, you will find an id property, which represents the file ID.
Some actions and triggers that return a file ID:
- Create New Text File
- Get File
- List Files
- Upload File
- New File trigger
How to find Folder ID
The best way to find a folder ID is to use the output of one of the Microsoft OneDrive actions. In the output, you will find an id property, which represents the folder ID.
Some actions that return a folder ID:
- Create Folder
- List Folders
How is this guide?
Last updated on