Skip to main content

Dropbox Component

Manage files stored in Dropbox

Component key: dropbox

Description#

Dropbox is a file sharing platform that allows teams to collaborate and share files with one another. The Dropbox component allows you to interact with the Dropbox API. You can upload, download, list, and move files within a Dropbox account.

A common integration pattern involves listing files in a file store, and performing a series of actions on the array of files that are returned. See our looping over files quickstart for information about how to create a loop over an array of files.

Dropbox Connections#

OAuth 2.0#

This component uses OAuth 2.0 to connect to Dropbox's API. To create a Dropbox OAuth 2.0 app, log in to Dropbox and open https://www.dropbox.com/developers/apps:

  1. Select Create app.
  2. Select that you want Scoped access.
  3. Choose the type of access you want:
    1. App folder access gives you access to a single folder in the user's Apps/ directory. A folder will be created with the same name as your OAuth app.
    2. Full Dropbox access gives you access to all files and folders in a user's Dropbox account.
  4. Give your app a name and click Create app.

Take note of the App key and App secret - you'll enter these in a Dropbox connection config variable.

Under the OAuth2 section add https://oauth2.prismatic.io/callback as a Redirect URI.

Under the Permissions tab, choose the permissions your app will need. The actions supported in this component relate to files, so you should grant the files.metadata.read and files.content.read permissions if you need read-only access, and also include the files.metadata.write and files.content.write permissions if you need to write files to a user's Dropbox account. You can safely ignore permissions listed under Collaboration and Account Info.

InputDefaultNotes
Input
Authorize URL
string
/ Required
Hidden Field
Default
https://www.dropbox.com/oauth2/authorize?token_access_type=offline
Notes
The OAuth 2.0 Authorization URL for Dropbox
Input
App Key
string
/ Required
Default
 
Notes
Generate at https://www.dropbox.com/developers/apps
Input
App Secret
password
/ Required
Default
 
Notes
Generate at https://www.dropbox.com/developers/apps
Input
Scopes
string
Hidden Field
Default
Notes
Dropbox permission scopes are set within Dropbox on the OAuth application
Input
Token URL
string
/ Required
Hidden Field
Default
https://api.dropboxapi.com/oauth2/token
Notes
The OAuth 2.0 Token URL for Dropbox

Actions#

Copy Object#

Copy a Folder or File from one path to another | key: copyObject

InputNotesExample
Input
Connection
connection
/ Required
Notes
 
Example
 
Input
From Path
string
/ Required
Notes
The location of a source file within a Dropbox share. Include a leading /.
Example
/path/to/source/file.txt
Input
To Path
string
/ Required
Notes
The location of a destination file within a Dropbox share. Include a leading /.
Example
/path/to/destination/file.txt

Output Example Payload#

{  "data": {    "status": 200,    "headers": {},    "result": {      "metadata": {        ".tag": "file",        "name": "myCopy",        "id": "exampleId",        "client_modified": "Wed, 01 Jan 2020 00:00:00 GMT",        "server_modified": "Wed, 01 Jan 2020 00:00:00 GMT",        "size": 2048      }    }  }}

Create Folder#

Create a Folder at the specified path | key: createFolder

InputNotesExample
Input
Connection
connection
/ Required
Notes
 
Example
 
Input
Path
string
/ Required
Notes
The location of a file within a Dropbox share. Include a leading /.
Example
/path/to/file.txt

Output Example Payload#

{  "data": {    "status": 200,    "headers": {},    "result": {      "metadata": {        "id": "exampleId",        "name": "myFolderName"      }    }  }}

Delete Object#

Delete a Folder or File at the specified path | key: deleteObject

InputNotesExample
Input
Connection
connection
/ Required
Notes
 
Example
 
Input
Path
string
/ Required
Notes
The location of a file within a Dropbox share. Include a leading /.
Example
/path/to/file.txt

Output Example Payload#

{  "data": {    "status": 200,    "headers": {},    "result": {      "metadata": {        ".tag": "file",        "name": "myCopy",        "id": "exampleId",        "client_modified": "Wed, 01 Jan 2020 00:00:00 GMT",        "server_modified": "Wed, 01 Jan 2020 00:00:00 GMT",        "size": 2048      }    }  }}

Download File#

Download the file (< 150MB) at the specified path | key: downloadFile

InputNotesExample
Input
Connection
connection
/ Required
Notes
 
Example
 
Input
Path
string
/ Required
Notes
The location of a file within a Dropbox share. Include a leading /.
Example
/path/to/file.txt

Output Example Payload#

{  "data": {    "type": "Buffer",    "data": [      101,      120,      97,      109,      112,      108,      101    ]  },  "contentType": "application/octet"}

List Folder#

List Folder contents at the specified path | key: listFolder

InputNotesExample
Input
Cursor
string
Notes
Specify the cursor returned by your last call to list_folder or list_folder/continue.
Example
lslTXFcbLQKkb0vP9Kgh5hy0Y0OnC7Z9ZPHPwPmMnxSk3eiDRMkct7D8E
Input
Connection
connection
/ Required
Notes
 
Example
 
Input
Limit
string
Notes
The maximum number of results to return per request. Note: This is an approximate number and there can be slightly more entries returned in some cases.
Example
25
Input
Directory Path
string
Notes
The path to a directory within a Dropbox share. Include a leading /.
Example
/path/to/my/directory/

Output Example Payload#

{  "data": {    "status": 200,    "headers": {},    "result": {      "entries": [        {          ".tag": "folder",          "id": "exampleId",          "name": "MyExampleFolder",          "path_lower": "/myexamplefolder"        },        {          ".tag": "file",          "id": "exampleId",          "name": "MyImage.jpg",          "path_lower": "/myexamplefolder/myimage.jpg",          "client_modified": "Wed, 01 Jan 2020 00:00:00 GMT",          "server_modified": "Wed, 01 Jan 2020 00:00:00 GMT",          "rev": "681a01c39731",          "size": 213654        }      ],      "cursor": "hgL45HTslKOhj1_GEut-DVuaNs4xrXzpwQZRyJ0-KCW0wWMQ5DZu68__ULJa0zDcBp3ZrMlCj3-ZuOy4kjc9H2o7Ohk9UsId0sxVZrXFX",      "has_more": true    }  }}

Move Object#

Move a Folder or File from one path to another | key: moveObject

InputNotesExample
Input
Connection
connection
/ Required
Notes
 
Example
 
Input
From Path
string
/ Required
Notes
The location of a source file within a Dropbox share. Include a leading /.
Example
/path/to/source/file.txt
Input
To Path
string
/ Required
Notes
The location of a destination file within a Dropbox share. Include a leading /.
Example
/path/to/destination/file.txt

Output Example Payload#

{  "data": {    "status": 200,    "headers": {},    "result": {      "metadata": {        ".tag": "file",        "name": "myCopy",        "id": "exampleId",        "client_modified": "Wed, 01 Jan 2020 00:00:00 GMT",        "server_modified": "Wed, 01 Jan 2020 00:00:00 GMT",        "size": 2048      }    }  }}

Upload File#

Upload a file to the specified path | key: uploadFile

InputNotesExample
Input
Connection
connection
/ Required
Notes
 
Example
 
Input
File Contents
data
/ Required
Notes
The contents to write to a file. This can be a string of text, it can be binary data (like an image or PDF) that was generated in a previous step.
Example
My File Contents
Input
Path
string
/ Required
Notes
The location of a file within a Dropbox share. Include a leading /.
Example
/path/to/file.txt

Output Example Payload#

{  "data": {    "status": 200,    "headers": {},    "result": {      "id": "exampleId",      "client_modified": "Wed, 01 Jan 2020 00:00:00 GMT",      "server_modified": "Wed, 01 Jan 2020 00:00:00 GMT",      "size": 2048,      "name": "myFileName"    }  }}