OneDrive

Discover more about the OneDrive component and how to use it on the Digibee Integration Platform.

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.

Parameters

Take a look at the configuration options for the component. Parameters supported by Double Braces expressions are marked with (DB).

Parameter
Description
Default value
Data type

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.

N/A

String

Operation

Operation to be executed (List, List Search, Pagination, Download, Download by File ID, Upload, or Delete).

Upload

String

Remote Directory (DB)

Base remote directory, which can be relative (e.g., pub/tmp) or absolute (e.g., /root/pub). This parameter supports Double Braces.

folder

String

Page Size

Used in the List and List Search operations, which refers to the amount of objects returned in the search.

N/A

Integer

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.

N/A

String

Next Page

Present in the Pagination operation.

N/A

String

File Name (DB)

File name or full file path (i.e. tmp/processed/file.txt). This parameter supports Double Braces.

local-test.pdf

String

Remote File Name (DB)

Remote file name or full path (i.e. tmp/processed/file.txt) to the remote file. This parameter supports Double Braces.

test.pdf

String

File ID

Unique identifier of a file.

N/A

String

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.

True

Boolean

Parameters additional information

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.

Messages flow

Output

List and List Search operations

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).

Download 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.

Download by File ID operation

{
    "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.

Upload operation

{
  "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.

Delete operation

{
    "fileId": "FILE_ID",
    "success": true
}
  • fileId: unique identifier of the file.

  • success: "true" if the operation was successful, "false" if otherwise.

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 updated