cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Re: list_folders and list_mountable_folders Returns Old and Deleted folders

list_folders and list_mountable_folders Returns Old and Deleted folders

Kevin B.36
Collaborator | Level 8

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:

  1. Where is Dropbox dragging all these olde/deleted/unshared folder up from?
  2. How can I stop the /list_mountable_folders - /list_folders from retrieving them?
  3. Am I using the wrong end point(s), if so what's the correct endpoint?

Any assistance appreciated.

4 Replies 4

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.36
Collaborator | 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.

Kevin B.36
Collaborator | Level 8

Greg,

 

Yes, I finally figured that out with your advice and a working example and am now getting parameters passed and a 200 return code. Thanks for the heads up.

Need more support?