Take Your Search Game to the Next Level with Dropbox Dash 🚀✨ Curious how it works? Ask us here!
Forum Discussion
Kevin B.36
8 years agoCollaborator | Level 8
list_folders and list_mountable_folders Returns Old and Deleted folders
Hi,
I have 42 folders in my Web Dropbox. 43 if you count the deleted folder. When I use either /list_folders or /list_mountable_folders I get 88 folders returned in the JSON string. The other 46 (more than I actually have) are for folders I may have been involved in a share, may have created for testing, probably deleted more than 2 years ago, ie. most if not all were created for testing purpose. They include names like the windows default New Folder (3). Hardly anything I'm likely to retain?
Three questions:
- Where is Dropbox dragging all these olde/deleted/unshared folder up from?
- How can I stop the /list_mountable_folders - /list_folders from retrieving them?
- Am I using the wrong end point(s), if so what's the correct endpoint?
Any assistance appreciated.
4 Replies
Sort By
- Greg-DB
Dropbox Staff
1. It sounds like you're referring to using the endpoints /2/sharing/list_folders[/continue] and /2/sharing/list_mountable_folders[/continue]. The /2/sharing/list_folders[/continue] endpoints will return shared folders you currently have in your account. The /2/sharing/list_mountable_folders[/continue] endpoints will return shared folders you can use, even if they are not currently mounted in your account. For example, these would be shared folders you were invited to but never added to your account, or deleted from your account.
2. If you want to remove these old shared folders, you can use /2/sharing/relinquish_folder_membership.
3. If you want to just list the current contents of your account, you should use /2/files/list_folder[/continue] instead. Note that it's under /files, instead of /sharing. Supply a path of the empty string "" if you want to list everything in the root folder.
- Kevin B.36Collaborator | Level 8
Hi Greg,
Thanks for the response.
OK, 1. sounds strange, I have no idea why this would be remotely useful or, more importantly, why it would be the default return.
2. Yes, but that means I have to identify and individually call every folder. We are writing an application that when deployed, it will have no idea which folders should or should not be relinquished.
3. I've tried this, but keep getting a bad request (400) when passing an empty string. We are using delphi and I've tried initialising a variable to '"" and setting the values to '/2/files/list_folder ' + VARIABLE and I've also tried '/2/files/list_folder ""'. both return the bad request error.
I will persevere with that option and see what I can get to work.
Kevin
- Greg-DB
Dropbox Staff
For the 400 error, make sure you check the response body. It should contain a more useful error indicating the issue.
The path value should be passed in JSON in the body (not in the URL itself) as shown in the example in the documentation:
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
If that's not working for you, share your code and output so we can take a look.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,988 PostsLatest Activity: 19 hours 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!