How to GET all files from the Dropbox API

Dropbox is a cloud-based file storage hosting and sharing platform that offers solutions across enterprise and consumer. They have deep integrations with workplace and collaboration platforms and many larger companies use Dropbox to collaborate and share assets. A common query when it comes to using the Dropbox API is how to GET all files from the Dropbox API and how to handle authentication.

We’ll be using Postman to demonstrate how to get Dropbox files via the API.

{{blog-cta-100+}}

Preparation

In order to access Dropbox’s API, you’ll first need a sandbox Dropbox account, as well as an OAuth application to get an access token.

The best way to get both of these is to create a Dropbox developer account.

1. Sign up for a developer account here. Click Create apps to sign up.

2. Once you’re done signing up, navigate here and click Create app.

3. Choose “Scoped access” and “Full Dropbox”, so that your app has access to all files & folders.

4. For this article, we’ll just be showing you how to access the API. So instead of implementing the full OAuth flow, we’ll generate a temporary access token. Click Generate access token to generate an access token. Save the token, as we’ll be using it to make API calls.

And now you’ve set up your developer account as well as an OAuth app!

To get a sandbox Dropbox account, simply sign up for a free account here.

Related: How the most popular file storage APIs work

Getting files & folders from Dropbox

Create a new collection in Postman. In the Authorization section, select Bearer Token as the type. Copy and paste your access token into Token.

At the highest level, Dropbox is organized by namespaces. To access the namespaces, make the following API call:

POST https://api.dropboxapi.com/2/team/namespaces/list


Before accessing the files in the namespace, you’ll need a user’s account ID. This is required by Dropbox to impersonate a user to access files and folders. Make an API call to:

POST https://api.dropboxapi.com/2/team/members/list

To access all files and folders within the namespace, including nested folders and files, you’ll need the following.

Make an API call to:

POST https://api.dropboxapi.com/2/files/list_folder

Include <code class="blog_inline-code">Dropbox-API-path_Root</code> in the header, with the following header value:

{".tag": "root", "root": "[INSERT NAMESPACE ID]"}

Include <code class="blog_inline-code">Dropbox-API-Select-Admin</code> in the header, with header value equal to any of the admin <code class="blog_inline-code">team_member_id</code> from the previous step.

Add the path of the namespace in the path, add 2 parameters:

<code class="blog_inline-code">path</code> to indicate which folder or namespace to pull from. Here, use the namespace id, and prepend it with <code class="blog_inline-code">ns:</code>.

<code class="blog_inline-code">recursive</code> to indicate whether to get nested files and folders, not just the immediate files & folders under the namespace. Here, set to true.

The initial API call will most likely not return all files and folders. You’ll have to use cursor-based pagination, and you’ll make a call to:

POST https://api.dropboxapi.com/2/files/list_folder/continue

That wraps up how to get all files and folders in your Dropbox account via API!

Related: A guide to retrieving folders from the Dropbox API via Python

Building a production-level integration

There are a few factors to consider when turning this simple POC into a production-level integration:

  • You’ll need to implement cursor-based pagination. Dropbox uses a separate endpoint <code class="blog_inline-code">https://api.dropboxapi.com/2/files/list_folder/continue</code> with a provided cursor to output the rest of the response. This is especially important so that you don’t miss any data.
  • If you need to do periodic syncs, you’ll also need to implement periodic polling of the Dropbox APIs. You’ll also have to implement rate-limit handling to make sure you don’t exceed Dropbox’s rate limits.
  • You’ll need to implement logic to handle the Dropbox OAuth flow, including providing a redirect URI and a bit of front-end support. You’ll be unable to use the expiring access token for production purposes.

Conclusion

This article showed you how to GET all files from Dropbox.

As your integration needs grow, Merge connects your product to hundreds of integrations with one single API in HR, recruiting, accounting, ticketing, CRM, and marketing automation.

If your organization needs to not only GET files from Dropbox, but also SharePoint, Box, Google Drive, and others, check out the Merge File Storage Unified API! As with all of Merge’s Unified APIs, one API connection is enough to offer your users integrations to all File Storage platforms.

Learn more about Merge by scheduling a demo with one of our integration experts.

But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
“It was the same process, go talk to their team, figure out their API. It was taking a lot of time. And then before we knew it, there was a laundry list of HR integrations being requested for our prospects and customers.” gradient text
“It was the same process, go talk to their team, figure out their API. It was taking a lot of time. And then before we knew it, there was a laundry list of HR integrations being requested for our prospects and customers.” gradient text
“It was the same process, go talk to their team, figure out their API. It was taking a lot of time. And then before we knew it, there was a laundry list of HR integrations being requested for our prospects and customers.” gradient text

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
“It was the same process, go talk to their team, figure out their API. It was taking a lot of time. And then before we knew it, there was a laundry list of HR integrations being requested for our prospects and customers.”

Daniel Marashlian - Co-Founder & CTO

This is a link inside of a rich text

  • List item
  • List item
  • List item
  1. List item
  2. List item
  3. List item
Caption goes here
This is some text inside of a div block.
Table of contents
Add hundreds of integrations to your product through Merge’s Unified API
Get a demo
Just for you

How to GET all files from the Dropbox API

Max Gong
Platform
@Merge

Dropbox is a cloud-based file storage hosting and sharing platform that offers solutions across enterprise and consumer. They have deep integrations with workplace and collaboration platforms and many larger companies use Dropbox to collaborate and share assets. A common query when it comes to using the Dropbox API is how to GET all files from the Dropbox API and how to handle authentication.

We’ll be using Postman to demonstrate how to get Dropbox files via the API.

{{blog-cta-100+}}

Preparation

In order to access Dropbox’s API, you’ll first need a sandbox Dropbox account, as well as an OAuth application to get an access token.

The best way to get both of these is to create a Dropbox developer account.

1. Sign up for a developer account here. Click Create apps to sign up.

2. Once you’re done signing up, navigate here and click Create app.

3. Choose “Scoped access” and “Full Dropbox”, so that your app has access to all files & folders.

4. For this article, we’ll just be showing you how to access the API. So instead of implementing the full OAuth flow, we’ll generate a temporary access token. Click Generate access token to generate an access token. Save the token, as we’ll be using it to make API calls.

And now you’ve set up your developer account as well as an OAuth app!

To get a sandbox Dropbox account, simply sign up for a free account here.

Related: How the most popular file storage APIs work

Getting files & folders from Dropbox

Create a new collection in Postman. In the Authorization section, select Bearer Token as the type. Copy and paste your access token into Token.

At the highest level, Dropbox is organized by namespaces. To access the namespaces, make the following API call:

POST https://api.dropboxapi.com/2/team/namespaces/list


Before accessing the files in the namespace, you’ll need a user’s account ID. This is required by Dropbox to impersonate a user to access files and folders. Make an API call to:

POST https://api.dropboxapi.com/2/team/members/list

To access all files and folders within the namespace, including nested folders and files, you’ll need the following.

Make an API call to:

POST https://api.dropboxapi.com/2/files/list_folder

Include <code class="blog_inline-code">Dropbox-API-path_Root</code> in the header, with the following header value:

{".tag": "root", "root": "[INSERT NAMESPACE ID]"}

Include <code class="blog_inline-code">Dropbox-API-Select-Admin</code> in the header, with header value equal to any of the admin <code class="blog_inline-code">team_member_id</code> from the previous step.

Add the path of the namespace in the path, add 2 parameters:

<code class="blog_inline-code">path</code> to indicate which folder or namespace to pull from. Here, use the namespace id, and prepend it with <code class="blog_inline-code">ns:</code>.

<code class="blog_inline-code">recursive</code> to indicate whether to get nested files and folders, not just the immediate files & folders under the namespace. Here, set to true.

The initial API call will most likely not return all files and folders. You’ll have to use cursor-based pagination, and you’ll make a call to:

POST https://api.dropboxapi.com/2/files/list_folder/continue

That wraps up how to get all files and folders in your Dropbox account via API!

Related: A guide to retrieving folders from the Dropbox API via Python

Building a production-level integration

There are a few factors to consider when turning this simple POC into a production-level integration:

  • You’ll need to implement cursor-based pagination. Dropbox uses a separate endpoint <code class="blog_inline-code">https://api.dropboxapi.com/2/files/list_folder/continue</code> with a provided cursor to output the rest of the response. This is especially important so that you don’t miss any data.
  • If you need to do periodic syncs, you’ll also need to implement periodic polling of the Dropbox APIs. You’ll also have to implement rate-limit handling to make sure you don’t exceed Dropbox’s rate limits.
  • You’ll need to implement logic to handle the Dropbox OAuth flow, including providing a redirect URI and a bit of front-end support. You’ll be unable to use the expiring access token for production purposes.

Conclusion

This article showed you how to GET all files from Dropbox.

As your integration needs grow, Merge connects your product to hundreds of integrations with one single API in HR, recruiting, accounting, ticketing, CRM, and marketing automation.

If your organization needs to not only GET files from Dropbox, but also SharePoint, Box, Google Drive, and others, check out the Merge File Storage Unified API! As with all of Merge’s Unified APIs, one API connection is enough to offer your users integrations to all File Storage platforms.

Learn more about Merge by scheduling a demo with one of our integration experts.

“It was the same process, go talk to their team, figure out their API. It was taking a lot of time. And then before we knew it, there was a laundry list of HR integrations being requested for our prospects and customers.”

Name
Position
Max Gong
Platform
@Merge

Read more

How to GET tasks from the Asana API in Python

Engineering

How to GET folders from the Dropbox API in Python

Engineering

10 critical REST API interview questions for 2025—answered

Engineering

Subscribe to the Merge Blog

Subscribe to the Merge Blog

Subscribe

Make integrations your competitive advantage

Stay in touch to learn how Merge can unlock hundreds of integrations in days, not years

Get a demo

Make integrations your competitive advantage

Stay in touch to learn how Merge can unlock hundreds of integrations in days, not years

Get a demo

Get our best content every week

Our weekly newsletter provides the best practices you need to build high performing product integrations.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.