Overview
Dropbox is a popular cloud storage service. Its main purpose is to let you store your files online, sync them across all your devices, and easily share them with other people.Configuration Guide
Understanding Dropbox API
Understanding Dropbox API
User & Teams Client
User Client is designed to interact with an individual user’s Dropbox account. Think of this as managing a personal workspace. These endpoints can also be called via the Team client, but require specifying the user to act on behalf of.Team Client is specifically for Dropbox Business or Enterprise accounts. They include endpoints that are used to manage an entire team or organization’s Dropbox environment from an administrative perspective.APIs Documentation
- Dropbox Individual API: https://www.dropbox.com/developers/documentation/http/documentation
- Dropbox Teams API: https://www.dropbox.com/developers/documentation/http/teams
Concept of Cursor
A cursor is a short string that acts like a bookmark for keeping track of changes in a folder.When you first list the contents of a folder using an endpoint like/files/list_folder, the API response includes a cursor. This cursor represents the exact state of that folder at that moment.Instead of re-downloading the entire list of files to check for changes, you can simply pass that cursor to the /files/list_folder/continue endpoint. The API will then return only the files and folders that have been added, modified, or deleted since you last received that cursor. This makes syncing changes highly efficient as you only process the differences.Create Dropbox App
Create Dropbox App
This guide will walk you through the process of creating a Dropbox application and connecting it to PipesHub to fetch your files and folders.



Dropbox Team Account
Step 1: Create a Dropbox App
- Navigate to the Dropbox App Console and sign in with your Dropbox credentials.
- Click the Create app button on the top right.

-
Configure your new app with the following settings:
- Choose an API: Select Scoped access.
- Type of access: Select Full Dropbox.
- Name your app: Enter a unique name for your application, for example, “Pipeshub Connector”.
- Click Create app. You will be redirected to your new app’s settings page.
Step 2: Configure Permissions and Redirect URI
- On your app’s page, navigate to the Permissions tab.

-
Under Individual Scopes, check the boxes for the permissions PipesHub needs to access your data:
account_info.readfiles.content.readfiles.metadata.readfile_requests.readsharing.readsharing.write
-
Under Team Scopes, check the boxes:
groups.readmembers.readteam_data.memberteam_data.team_spaceteam_info.readevents.read
- Click Submit at the bottom of the page to save your changes.

- Now, go to the Settings tab.
- You also need to enable additional Development users.
- Find the OAuth 2 section and add the following URL to the Redirect URIs field (where is your PipesHub instance URL):
- Click Add to save the URI.

Step 3: Copy App Key and Secret
- While still in the Settings tab, locate the App key and App secret.
- Click the Show button to reveal your App secret.
- Copy both the App key and the App secret. You will need these for the next step.
Connect Dropbox to PipesHub
Connect Dropbox to PipesHub
Step 1: Configure Connection
- Open your PipesHub application and navigate to Connections Settings.
- Select Dropbox Teams from the list of available data sources.
- Paste the App key into the “Client ID” field.
- Paste the App secret into the “Client Secret” field.

Step 2: Set Sync Strategy
Click Next here you can setup your sync strategy either Manual, Scheduled or via Webhooks (to be implemented). On scheduled you can setup to run sync every 15 min, 30mins, 1hr, 4hr etc. And also decide batch size (this is an internal connector settings that decide how many items should the connector sync to ArangoDB at once) leave it empty if you want to go with default option 100.
Step 3: Authenticate and Enable
- Click Save Configuration. Now the authenticate button will be active, click on it and you will be taken to dropbox to authorize your app (make sure you are logged in to correct dropbox account).
- After granting access, you will be redirected back to PipesHub, and your Dropbox account will be successfully connected, once you enable the connector your files will start syncing.
Connector Workflow
Synchronization Process
Synchronization Process
How Does Dropbox Connector Work?
Each connector, including theDropboxConnector is a child class (or concrete class) that inherits from BaseConnector. It implements the following abstract methods:inittest_connection_and_accessget_signed_urlstream_recordrun_syncrun_incremental_synchandle_webhook_notificationcleanupcreate_connector(class method)
Dropbox Connector Initialization
Workflow for Dropbox sync works like:run_sync - Syncs 4 items:- Users
- User Groups
- Record Groups (aka Team folders + Personal folder in Dropbox)
- Files and Folders - for each user
member_events, user_group_events, record_group_events.If no cursor is initialized for that event, we run full sync.User Sync Workflow
Users are fetched from Dropbox then converted to typeAppUser using function get_app_users.First Sync
Fetches all users from Dropbox Teams then initializes a sync point:member_events which saves cursor to be used for incremental sync, then sends the users to data_entities_processor.on_new_app_users.Incremental Sync
Uses the saved cursor to call team logs in ‘members’ category and listens formember_change_status events.- Member Added: If a user’s status changes to active, the system treats them as a new addition and processes their profile.
- Member Removed: If a user’s status changes to removed, they are not removed from PipesHub as they might still be part of team.
User Group Sync Workflow
Full Sync (Initial Run)
A full sync is executed when no event cursor is found in the database.-
Fetch All Groups: The system retrieves a complete list of all user groups from the Dropbox API, also handles pagination in case result exceeds limits:
team_groups_list -
Fetch Members for Each Group: It then iterates through every group and fetches a complete list of its members:
_fetch_group_members - Batch Processing: Instead of processing each group individually, the system prepares a single, large batch. This batch contains all groups and their corresponding members with their assigned permissions (e.g., Owner, Write).
-
Single Submission: Once all groups and members have been collected, the entire batch is sent to the data processor
data_entities_processor.on_new_user_groups.
Incremental Sync
Once a cursor is established (like in Users events), it runs incremental sync to only process events that are new since last sync.-
Fetch Events: Using the saved cursor as a bookmark, the connector asks the Dropbox API for all group-related events that have occurred since the last run and calls
_process_group_event. - Process Changes: Each event is handled individually. The system processes a variety of changes, including group creation, deletion, renaming, membership adjustments, and role updates.
- Update Cursor: After processing the events, the new cursor from the API is saved, bookmarking the position for the next sync cycle.
Record Groups Sync Workflow
First Sync
Team Folders
The sync begins by fetching a complete list of all Team Folders in the Dropbox account. This requires a team admin user’s credentials to authorize the API calls. For each active folder, the system:- Fetches a complete list of all members, including both individual users and user groups.
- Maps the Dropbox access levels (owner, editor, viewer) to the system’s internal permission types.
- Creates a Record Group for the folder and sends it to the processor along with the full list of member permissions.
Personal Folders
After syncing Team Folders, the system creates a “Personal Folder” Record Group for every individual user. Each user is automatically assigned OWNER permission to their own personal space. This batch of personal folders is then sent to the processor.Incremental Sync
This incremental process only applies to Team Folders. It uses a saved cursor to fetch events from the Dropbox audit log related to team folder activity. The system listens for and processes specific events such as:team_folder_createteam_folder_renameteam_folder_archivedteam_folder_permanently_delete
Files and Folders Sync Workflow
Workflow Overview
-
Initiation: The main
run_syncfunction orchestrates the entire process. After handling users and groups, it calls_process_users_in_batchesto begin the file sync. -
Batch Processing: The
_process_users_in_batchesfunction processes active users concurrently. For each user, it calls_run_sync_with_yield. -
Sync Scopes: Inside
_run_sync_with_yield, an API call tosharing_list_foldersidentifies all sync targets for a user (their personal folder and any shared team folders). The function then loops through each target to sync it individually.
Detailed Process
-
Per-Folder Tracking: For each folder,
_run_sync_with_yieldcallsdropbox_cursor_sync_point.read_sync_pointto retrieve the last known sync cursor. This cursor determines where the sync should resume. - Data Fetching: The function then enters a loop to fetch changes from Dropbox.
- It calls
files_list_folderfor an initial sync orfiles_list_folder_continueif a cursor exists. - The results from the API are passed to
_process_dropbox_items_generator.
- Individual Item Processing: The generator loops through each item and calls
_process_dropbox_entryto do the main conversion work. This function:
- Calls
tx_store.get_record_by_external_idto check if the item already exists in the local database. - Calls
_convert_dropbox_permissions_to_permissionsto fetch and format the item’s access rights. - Returns a
RecordUpdateobject summarizing the changes.
- Database Updates: Back in
_run_sync_with_yield, the results are handled:
- New records are batched and sent to
data_entities_processor.on_new_records. - Updated or deleted items are passed to
_handle_record_updates, which then calls specific methods likedata_entities_processor.on_record_content_updateoron_record_deleted.
- State Management: After a page of changes is processed,
_run_sync_with_yieldcallsdropbox_cursor_sync_point.update_sync_pointto save the new cursor for that specific folder, ensuring the next sync is incremental.
Sharing & Permission Sync
This is an incremental, event-driven process designed to keep file and folder permissions up-to-date.Workflow
- Listen for Events: Using a saved cursor, the system listens for specific sharing events in the Dropbox audit log, such as when a member is added, removed, or has their role changed on a file or folder.
- Trigger Re-Sync: An event is treated as a notification that a file or folder’s permissions have changed. Instead of just applying the single change, the system triggers a full re-sync of that specific item.
- Fetch Fresh Data: It makes a new API call to Dropbox to fetch the latest, complete metadata for the affected file or folder. This ensures the system gets the current, authoritative state of all permissions on that item.
- Process and Update: The fresh data is processed, and the item’s permissions are updated in the database to reflect the latest state.
- Update Cursor: Finally, the new cursor is saved to mark the position for the next sync.
















