How to download all documents from Dropbox Sign via the API
In this article
Using Dropbox Sign API
To download all your documents using the API, we recommend looping through all the pages of the List Signature Requests endpoint to obtain all the signature_request_ids. Then loop through the list of signature_request_ids to download each document using the Get Files endpoint.
Note: The steps below require coding/software development capabilities in order to be accomplished. For a different option to download all documents, please check the Team sync feature, which is described at the bottom of this article.
Here's an example using the Ruby SDK:
- Initiate Dropbox Sign with your account's API Key.
require 'dropbox_sign'
Dropbox::Sign.configure do |config|
# Configure HTTP basic authorization: api_key
config.username = "YOUR_API_KEY"
# or, configure Bearer (JWT) authorization: oauth2
# config.access_token = "YOUR_ACCESS_TOKEN"
end
- Obtain the total number of pages of signature requests returned from the list signature requests endpoint and loop through the pages of the signature requests to combine into one list.
Optional: If you’re part of a Dropbox Sign team and would like to retrieve your team’s signature requests, add the parameter account_id=”all” and pass it as a parameter into the signature_request_api.signature_request_list call.
def get_all_signature_requests
signature_request_api = Dropbox::Sign::SignatureRequestApi.new
page_size=100
result = signature_request_api.signature_request_list({page_size: page_size})
total_pages = result.list_info.num_pages
signature_requests=[]
total_pages.times do |page_number|
result = signature_request_api.signature_request_list({page_size: page_size, page_number:page_number+1})
signature_requests += result.signature_requests
end
- [Optional] Returns the total number of signature requests and the list of signature_request_ids.
puts signature_requests.size
puts signature_requests.map {|s| s.signature_request_id}
signature_requests
end
- Loop through all signature requests and download the completed documents. Our API offers three different endpoints for downloading files. Learn more about Dropbox Sign API Interacting with Files.
def download_requests(requests)
signature_request_api = Dropbox::Sign::SignatureRequestApi.new
requests.each do |req|
file_bin = signature_request_api.signature_request_files(req.signature_request_id,{file_type:"pdf"})
FileUtils.cp(file_bin.path, "/path/to/your/file#{req.signature_request_id}.pdf")
end
end
download_requests(get_all_signature_requests())
Note: When downloading all documents, please be mindful of the Dropbox Sign API rate limits. We do recommend executing the endpoint in small batches or delaying the execution of the endpoint to fit the rate limit.
Using the Dropbox Sign team level document syncing and storage feature
You can sync and download all your team’s Dropbox Sign documents to your preferred cloud storage provider.
Notes:
- This feature is only available on Premium plans.
- To use a different method to download all documents that doesn’t require using the Dropbox Sign API, team admins can use the Team sync feature.
To activate team document sync:
- Log in to your admin account.
- Hover over your email address in the top-right corner.
- Click Admin console.
- Click Settings in the left sidebar.
- Click Documents and templates in the left sidebar.
- Next to Team cloud sync, click Configure.
- Click Link my account next to your preferred cloud storage provider: Dropbox, Box, Google Drive, or OneDrive.
Once the process is complete, all the connected accounts on your team will appear in Connected accounts and a folder with the name of your team will be created in the storage integration.
All documents will sync, including retroactively, and can then be selected and downloaded from your preferred cloud storage.
Community answers
-
Posted by: Liberty1991 228 days ago
205
5
-
Posted by: OmniR1 899 days ago
735
4
-
Posted by: Amy 1749 days ago
280263
20
-
Posted by: Aryahagh 2424 days ago
6241
3
-
Posted by: Laurielounge 2774 days ago
2609
1