One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
Indoswift
3 years agoExplorer | Level 3
Not able to fetch the root folders
Hi,
I am using Dropbox HTTP API's to list and create folders to my dropbox account. I created an app in developer console and given all the permission to generated key but still when I am using list_folder API, Its showing one folder only which is inside a folder of root directory and when I m trying to create a folder on root its creating folder inside another folder. How can I get all the folder and files which are on my root. I tried all possibility but no success. Please help.
- Greg-DB
Dropbox Staff
To list the contents of a folder, you should use the /2/files/list_folder and /2/files/list_folder/continue endpoints. For the root folder, you should set the "path" parameter to the empty string "". Note that you're not guaranteed to get all of the results back in a single response, so be sure to implement both of those endpoints. Refer to the documentation for information on how to do so properly.
By the way, those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints.
Also, note that by default, API calls operate in the "member folder" of the connected account, so anything outside the member folder, such as in the "team space", if any, will not be found by default. You can configure API calls to operate in the "team space" instead though. To do so, you'll need to set the "Dropbox-Api-Path-Root" header. You can find information on this in the Team Files Guide. The File Access Guide may also be helpful.
- IndoswiftExplorer | Level 3
Hi,
Thank you so much for your support, I just added the Dropbox-Api-Path-Root with namespace id to the API call and things start working perfectly.
About Discuss Dropbox Developer & API
Make connections with other developers804 PostsLatest Activity: 2 days ago
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!