Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.
Forum Discussion
TAP
8 years agoExplorer | Level 4
API endpoint for list of folder names and paths?
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.
- 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".
4 Replies
- Greg-DB8 years ago
Dropbox Community Moderator
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". - TAP8 years agoExplorer | Level 4Thanks Greg!
- Yohancef7 years agoNew member | Level 2
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-DB7 years ago
Dropbox Community Moderator
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("");
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,038 PostsLatest Activity: 9 hours ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!