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.

Detecting changes in Dropbox

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

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.

Triggers

Dropbox Webhook Trigger

Trigger for handling webhooks from Dropbox's change API | key: dropboxWebhook


Data Sources

List Folders

Fetch an array of folders | key: listFolders | type: picklist

Data Source Payload

{
"result": [
{
"label": "/myexamplefolder - MyExampleFolder",
"key": "0"
},
{
"label": "/myexamplefolder/myimage.jpg - MyImage.jpg",
"key": "1"
}
]
}

List Shared Folders

Fetch an array of shared folders | key: listSharedFolders | type: picklist

Data Source Payload

{
"result": [
{
"label": "/myexamplefolder - MyExampleFolder",
"key": "0"
},
{
"label": "/myexamplefolder/myimage.jpg - MyImage.jpg",
"key": "1"
}
]
}

List Team Folders

Fetch an array of team's folders | key: listTeamFolders | type: picklist

Data Source Payload

{
"result": [
{
"label": "MyExampleFolder",
"key": "0"
}
]
}

Actions

Copy Object

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

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

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

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

Output Example Payload

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

Get Current Account

Get information about the currently authenticated user | key: getCurrentAccount

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"
}
}
}

Get File Lock

Return the lock metadata for the given list of paths | key: getFileLock


Get Team Members

Get Team Members by Member ID, External ID, or Email | key: getTeamMembers


List Changes

List changes that have been made to files in this folder since the last time this action was run. | key: listChanges

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 Folder

List Folder contents at the specified path | key: listFolder

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
}
}
}

List Shared Folders

List Shared Folders contents | key: listSharingFolder

Output Example Payload

{
"data": {
"status": 200,
"headers": {},
"result": {
"cursor": "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu",
"entries": [
{
"access_inheritance": {
".tag": "inherit"
},
"access_type": {
".tag": "owner"
},
"is_inside_team_folder": false,
"is_team_folder": false,
"link_metadata": {
"audience_options": [
{
".tag": "public"
},
{
".tag": "team"
},
{
".tag": "members"
}
],
"current_audience": {
".tag": "public"
},
"link_permissions": [
{
"action": {
".tag": "change_audience"
},
"allow": true
}
],
"password_protected": false,
"url": ""
},
"name": "dir",
"path_lower": "/dir",
"permissions": [],
"policy": {
"acl_update_policy": {
".tag": "owner"
},
"member_policy": {
".tag": "anyone"
},
"resolved_member_policy": {
".tag": "team"
},
"shared_link_policy": {
".tag": "anyone"
}
},
"preview_url": "https://www.dropbox.com/scl/fo/fir9vjelf",
"shared_folder_id": "84528192421",
"time_invited": "2016-01-20T00:00:00Z"
}
]
}
}
}

List Team's Folders

List Team's Folder contents | key: listTeamFolder

Output Example Payload

{
"data": {
"status": 200,
"headers": {},
"result": {
"cursor": "ZtkX9_EHj3x7PMkVuFIhwKYXEpwpLwyxp9vMKomUhllil9q7eWiAu",
"has_more": false,
"team_folders": [
{
"content_sync_settings": [
{
"id": "id:a4ayc_80_OEAAAAAAAAAXw",
"sync_setting": {
".tag": "default"
}
}
],
"is_team_shared_dropbox": false,
"name": "Marketing",
"status": {
".tag": "active"
},
"sync_setting": {
".tag": "default"
},
"team_folder_id": "123456789"
}
]
}
}
}

Lock File

Lock the files at the given paths | key: lockFile


Move Object

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

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
}
}
}
}

Raw Request

Send a raw HTTP request to Dropbox's API | key: rawRequest


Unlock File

Unlock the files at the given paths | key: unlockFile


Upload File

Upload a file to the specified path | key: uploadFile

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"
}
}
}