List the contents of a Dropbox folder
Overview
This workflow template uses the Dropbox API v2 to recursively retrieve all contents from a specified Dropbox root folder. By utilizing endpoints such as /files/list_folder
and /files/list_folder/continue
, the template efficiently gathers the contents of the folder, ensuring comprehensive access to files and directories.
Additionally, it sorts the retrieved contents alphabetically, enhancing organization and accessibility.
How the template works
-
Initial Content Listing: Upon triggering, the workflow initiates by listing the contents of the specified Dropbox root folder using the
/files/list_folder
endpoint. This step retrieves the initial set of files and directories present within the root folder. -
Recursive Retrieval with Continuation: If the initial content listing has more results, the workflow retrieves additional results using the
/files/list_folder/continue
endpoint. This recursive process ensures that all contents within the root folder, regardless of the quantity, are effectively retrieved. -
Alphabetical Sorting: Upon retrieving all contents, the workflow sorts them alphabetically.
How to use the template
Step 1: Create Dropbox OAuth 2.0 credentials
-
Ensure you have set up Dropbox OAuth 2.0 and have access to client ID and client secret.
-
Log in to the SimWorkflow.
-
Navigate to Credentials.
-
Click Create credentials button.
-
Select OAuth 2.0 tab.
-
Select Dropbox from the Provider dropdown.
-
Enter Dropbox in the Name field.
-
Enter the Client ID in the Client ID field.
-
Enter the Client secret in the Client secret field.
-
Enter the following scopes in the Scopes field:
- files.metadata.read
-
Click Create credentials button.
Step 2: Use this workflow template
-
Click Use this template button on the top right of this page.
-
Click List folder task and select Configuration tab.
-
Select Dropbox (OAuth 2.0) for Credentials field.
-
Click List folder (more) task and select Configuration tab.
-
Select Dropbox (OAuth 2.0) for Credentials field.
-
Click Save button.
-
Toggle the Enable checkbox to enable the workflow definition.