OneDrive
Know the component and how to use it.
OneDrive allows you to establish a connection with the Microsoft OneDrive service and enables the following operations: List, List Search, Pagination, Download, Download by File ID, Upload, or Delete.
Take a look at the configuration parameters of the component:
- Account: for the component to make the authentication of the OneDrive service, it's necessary to use an OAuth 2 account type of the Microsoft provider with at least the "offline_access" and "Files.ReadWrite.All" scope.
- Operation: operation to be executed (List, List Search, Pagination, Download, Download by File ID, Upload, or Delete).
- Remote Directory: base remote directory, which can be relative (eg.: pub/tmp) or absolute (eg.: /root/pub). This parameter supports Double Braces.
- Page Size: used in the List and List Search operations, which refers to the amount of objects returned in the search.
- Query: present in the List Search operation. This parameter defines the type of search that will be made in the OneDrive directories. For more information about this filter, visit the official Microsoft documentation.
- Next Page: present in the Pagination operation.
IMPORTANT: if a OneDrive component that is executing the List or List Search operation generates more results than Page Size, then a second OneDrive component can use the pagination operation and the Next Page parameter. It can occur manually or through Double Braces. Example: with {{ message. nextPage }}), more results of the previous operation will be shown.
- File Name: file name or full file path. This parameter supports Double Braces.
- Remote File Name: remote file name or relative path (eg.: tmp/file.txt) to the remote file. This parameter supports Double Braces.
- File ID: unique identifier of a file.
- Fail On Error: if the option is enabled, the execution of the pipeline with error will be interrupted; otherwise, the pipeline execution proceeds, but the result will show a false value for the “success” property.
Some of the parameters above support Double Braces. To better understand how this language works, read the Double Braces documentation.
When executing an OneDrive component by using the List and List Search operations, the following JSON structure will be generated:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('user%40hotmail.com')/drive/root/children",
"count": 5,
"nextPage": "https://microsoft.graph/nextPage?token=Md",
"value": [
{
"createdDateTime": "2010-10-07T23:25:28.99Z",
"cTag": "adDpEOUMxOTZEMzdEMkQxNT42MzcyODc4NjU2Nzg0MDAwMUHDA",
"eTag": "aRDlfdseMTk2RDRfdfDJEMTU5RSExEuMA",
"id": "DXCC196D37D2D159E!161",
"lastModifiedDateTime": "2020-06-26T16:42:47.84Z",
"name": "Documents",
"size": 49378390,
"webUrl": "https://1drv.ms/f/s!AGG4VLX3T6sHZgSE",
"reactions": {
"commentCount": 0
},
"createdBy": {
"user": {
"displayName": "NAME",
"id": "d9c196d37d2d159e"
}
},
"lastModifiedBy": {
"user": {
"displayName": "NAME",
"id": "d9de396d37d2d159e"
}
},
"parentReference": {
"driveId": "d9c196d37d2d159e",
"driveType": "personal",
"id": "XCC196D37D2D159E!160",
"path": "/drive/root:a_folder"
},
"fileSystemInfo": {
"createdDateTime": "2010-10-07T23:25:28.99Z",
"lastModifiedDateTime": "2010-10-07T23:25:28.99Z"
},
"folder": {
"childCount": 6,
"view": {
"viewType": "thumbnails",
"sortBy": "name",
"sortOrder": "ascending"
}
},
"specialFolder": {
"name": "documents"
}
}
]
}
- value[name]: folder or file name.
- value[size]: size in bytes.
- nextPage: URL to see more results (check Pagination operation).
{
"remoteDirectory": "REMOTE_DIRECTORY",
"remoteFileName": "remoteFileName"
"fileName": "file.ext",
"success": true
}
- remoteDirectory: base remote directory path (relative or absolute).
- remoteFileName: remote file path or remote file relative path.
- fileName: local file name.
- success: "true" if the operation was successful, "false" if otherwise.
{
"fileId": "FILE_ID",
"fileName": "file.ext",
"success": true
}
- fileId: unique identifier of the file
- fileName: local file name.
- success: "true" if the operation was successful, "false" if otherwise.
{
"remoteFileName": "remote_file.ext",
"remoteDirectory": "Documents"
"fileName": "file.ext",
"success": true
}
- remoteFileName: remote file path or remote file relative path.
- remoteDirectory: base remore directory path (relative or absolute).
- fileName: local file name.
- success: "true" if the operation was successful, "false" if otherwise.
{
"fileId": "FILE_ID",
"success": true
}
- fileId: unique identifier of the file.
- success: "true" if the operation was successful, "false" if otherwise.
IMPORTANT: the manipulation of files inside a pipeline occurs in a protected way. The files become available in a temporary directory that only the pipeline under execution has access to.
Read the article Messages processing to understand how this concept works in the Digibee Integration Platform.
Last modified 2mo ago