cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API endpoint for list of folder names and paths?

API endpoint for list of folder names and paths?

TAP
Explorer | Level 4
Go to solution

Is there an endpoint that will return a list of folder names and paths? Use-case: presenting my users with a dropdown containing various folders they may send a file to.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
Yes, to list files and folders in Dropbox, you should use the /2/files/list_folder[/continue] endpoints:

https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue

To list root, use the empty string "" as the path. To list a non-root path, pass in the path like "/path/to/folder".

View solution in original post

4 Replies 4

Greg-DB
Dropbox Staff
Go to solution
Yes, to list files and folders in Dropbox, you should use the /2/files/list_folder[/continue] endpoints:

https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-continue

To list root, use the empty string "" as the path. To list a non-root path, pass in the path like "/path/to/folder".

TAP
Explorer | Level 4
Go to solution
Thanks Greg!

Yohancef
New member | Level 2
Go to solution

Hi,

What's the C# equivalent of path: "" for the 'Files.ListFolderAsync(path)' method to display to root folder?

It seems to want it in 'id: somevalue' format.

Thanks.

Greg-DB
Dropbox Staff
Go to solution

@Yohancef With the .NET SDK, you would also pass an empty string to list the root folder. That would look like this:

var list = await client.Files.ListFolderAsync(string.Empty);

or:

var list = await client.Files.ListFolderAsync("");
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Yohancef New member | Level 2
  • User avatar
    TAP Explorer | Level 4
What do Dropbox user levels mean?