Covered in this article
Related pages
Latest Changelog
Version 1.1.0 ()
Dropbox component

Dropbox component

Component to interact with Dropbox.

General information

Description

Component to interact with Dropbox. Dropbox is a cloud storage service, which allows copy files to the cloud and accesses them later from a different device.

Technical Notes

The technical notes page gives some technical details about Dropbox component like changelog and completeness matrix.

SDK version

It is used Dropbox JavaScript SDK.

Environment variables

Name Mandatory Description Values
ATTACHMENT_MAX_SIZE false For elastic.io attachments configuration. Maximal possible attachment size in bytes. By default set to 1000000 and according to platform limitations CAN’T be bigger than that. Up to 1000000 bytes

Please Note: From the platform version 20.51 we deprecated the component LOG_LEVEL environment variable. Now you can control logging level per each step of the flow.

Credentials

The Dropbox SDK uses OAuth 2 for authorizing API requests. Dropbox requires an access token to make authenticated requests. You should create, set up your app, see OAuth guide, and generate access token.

Access Token

Use generated previously access token.

Triggers

This component has no trigger functions. This means it will not be accessible to select as a first component during the integration flow design.

Actions

Get File By Path

Action to get file from Dropbox by provided path

List of Expected Config fields

Allow Empty Result

Default No. In case No is selected - an error will be thrown when no files were found, If Yes is selected - an empty object will be returned instead of throwing an error.

Allow File name to be Omitted

Default No. In case No is selected - an error will be thrown when file path is missing in metadata, if Yes is selected - an empty object will be returned instead of throwing an error.

Enable File Attachments

Checkbox for attaching files content to action response

Metadata fields description

  • path - Full path to file

Input example:

{
    "path": "/inner_folder/file.any"
}

Output example:

  • Successful response
{
".tag": "file",
"name": "file.any",
"path_lower": "/file.any",
"path_display": "/file.any",
"id": "id:Ua3SpE_E_CAAAAAAAAAACA",
"client_modified": "2020-03-31T11:25:40Z",
"server_modified": "2020-03-31T11:25:40Z",
"rev": "015a224d3e0147b00000001b724db90",
"size": 28,
"is_downloadable": true,
"content_hash": "10931f016454cbd4d852632b81f2e5ab2502dc120e2afb7efcd6b64fb9d27e7a"
}

Upsert File

Action upserts (create or replace) with file from attachment by provided path in Microsoft One Drive. If more then 1 attachments (or no attachments) provided the action will throw an error:

Upsert File

Metadata fields description

  • Path - Full path to item to create or replace

Input example:

{
    "path": "/base_folder/inner_folder/file.any"
}

Output example:

  • Successful response
{
  ".tag": "file",
  "name": "file.any",
  "path_lower": "/file.any",
  "path_display": "/file.any",
  "id": "id:Ua3SpE_E_CAAAAAAAAAACA",
  "client_modified": "2020-03-31T11:25:40Z",
  "server_modified": "2020-03-31T11:25:40Z",
  "rev": "015a224d3e0147b00000001b724db90",
  "size": 28,
  "is_downloadable": true,
  "content_hash": "10931f016454cbd4d852632b81f2e5ab2502dc120e2afb7efcd6b64fb9d27e7a",
  "url": "http://maester-service.platform.svc.cluster.local:3002/objects/70d14266-37ae-46b7-b485-d4a2948b24e7?storage_type=maester"
}

Delete Folder Or File By Path

Action to delete folder or file from Dropbox by provided path:

Delete Folder Or File By Path

List of Expected Config fields

  • Throw an error in case if path not found - select the behavior in case when specified path not found.

Metadata fields description

  • Path - Full path to a file or a folder

Input example:

  {
      "path": "base_folder/inner_folder/file.any"
  }

Output example:

  • Error response example
  {
     "metadata":{
        "path":"/test/DeleteByPath/Document.docx"
     },
     "result":"path_lookup/not_found/...",
     "error":{
        ".tag":"path_lookup",
        "path_lookup":{
           ".tag":"not_found"
        }
     }
  }
  • Successful response
{
   "metadata":{
      ".tag":"file",
      "name":"Document.docx",
      "path_lower":"/test/deletebypath/document.docx",
      "path_display":"/test/DeleteByPath/Document.docx",
      "id":"id:o0yGDTvyrFAAAAAAAAAAIw",
      "client_modified":"2020-03-31T13:32:00Z",
      "server_modified":"2020-03-31T13:32:01Z",
      "rev":"015a22697b3373f000000013a1ecc50",
      "size":10982,
      "is_downloadable":true,
      "content_hash":"8424108d60c2a77a6c36355e4a974882a79ca4ecd25a611f0c0b68713d31a044"
   },
   "result":"deleted"
}

Create Folder

Create new folder in provided path. Path should contains folder name:

Create Folder

Input fields description

  • Conflict Behaviour - behaviour in case folder already exists. Default: Fail. Options: Fail, Rename, Skip.
    1. Fail - fails if folder with same name already exists under provided path
    2. Rename - rename folder if folder with same name already exists under provided path. Examples: exists -> exists (1), exists (1) -> exists (1) (1)
    3. Skip - ignore error for already existing folder, returns {} if selected

Metadata fields description

  • Path - Path to to folder where new folder will be created. Use empty string or / for root

Input example:

{
    "path": "/test/create/folder"
}

Output example:

  • Successful response
{
    "name": "Folder",
    "path_lower": "/test/create/folder",
    "path_display": "/test/create/Folder",
    "id": "id:U6e6XFFVGvAAAAAAAAAAlw"
}

Known Limitations

  1. Maximal possible size for an attachment is 10 MB.
  2. Attachments mechanism does not work with Local Agent Installation.

Click here to learn more about the elastic.io iPaaS