Dropbox Component
Manage files stored in Dropbox
Component key: dropbox#
DescriptionDropbox 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.
#
Detecting changes in DropboxThe List Changes action allows you to detect changes in your user's Dropbox folders. Create a flow that runs on a schedule and begin your flow with a List Changes action. That action will return a list of changes that have occurred since the flow was last run.
#
Dropbox Connections#
OAuth 2.0This 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:
- Select Create app.
- Select that you want Scoped access.
- Choose the type of access you want:
- 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. - Full Dropbox access gives you access to all files and folders in a user's Dropbox account.
- App folder access gives you access to a single folder in the user's
- 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.
Input | Default | Notes |
---|---|---|
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 ObjectCopy a Folder or File from one path to another | key: copyObject
Input | Notes | Example |
---|---|---|
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 FolderCreate a Folder at the specified path | key: createFolder
Input | Notes | Example |
---|---|---|
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 ObjectDelete a Folder or File at the specified path | key: deleteObject
Input | Notes | Example |
---|---|---|
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 FileDownload the file (< 150MB) at the specified path | key: downloadFile
Input | Notes | Example |
---|---|---|
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"}
#
Get Current AccountGet information about the currently authenticated user | key: getCurrentAccount
Input | Notes |
---|---|
Input Connection connection / Required | Notes |
#
Output Example Payload{ "data": { "account_id": "dbid:EXAMPLE", "name": { "given_name": "John", "surname": "Doe", "familiar_name": "John", "display_name": "John Doe", "abbreviated_name": "JD" }, "email": "john.doe@example.com", "email_verified": true, "profile_photo_url": "", "disabled": false, "country": "US", "locale": "en", "referral_link": "", "is_paired": true, "account_type": { ".tag": "basic" }, "root_info": { ".tag": "user", "root_namespace_id": "123456789", "home_namespace_id": "123456789" } }}
#
List ChangesList changes that have been made to files in this folder since the last time this action was run. | key: listChanges
Input | Default | Notes | Example |
---|---|---|---|
Input Directory Path string | Default | Notes The path to a directory within a Dropbox share. Include a leading /. | Example /path/to/my/directory/ |
Input Connection connection / Required | Default | Notes | Example |
Input Include Deleted? boolean / Required | Default false | Notes If true, the results will include entries for files and folders that used to exist but were deleted. | Example |
Input Recursive boolean / Required | Default false | Notes If true, the response will contain contents of all subfolders. | Example |
The first time this action runs, it takes note of the current cursor
returned by Dropbox, and returns no changes.
Subsequent runs of this step use that cursor
to determine what has changed since the last time this step ran.
#
Output Example Payload{ "data": { "entries": [ { ".tag": "deleted", "name": "my-old-image.png", "path_lower": "/my-old-image.png", "path_display": "/my-old-image.png" }, { ".tag": "file", "name": "my-new-image.png", "path_lower": "/my-new-image.png", "path_display": "/my-new-image.png", "id": "id:BTY6k_2K8PAAAAAAAAAX9g", "client_modified": "2022-12-12T21:39:30Z", "server_modified": "2022-12-12T22:40:57Z", "rev": "5efa9326918a601c39731", "size": 1758021, "is_downloadable": true, "content_hash": "dc05a61ecd59d294da1e971c4e40a980b9042c633b7bc777367991a046d2b32d" } ], "cursor": "AAFCBKRdVxEXAMPLE", "has_more": false }, "instanceState": { "step-id": "AAFCBKRdVxEXAMPLE" }}
#
List FolderList Folder contents at the specified path | key: listFolder
Input | Notes | Example |
---|---|---|
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 ObjectMove a Folder or File from one path to another | key: moveObject
Input | Notes | Example |
---|---|---|
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 FileUpload a file to the specified path | key: uploadFile
Input | Notes | Example |
---|---|---|
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" } }}