We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
rk90
7 years agoHelpful | Level 5
How do I get all files and folders on Dropbox Business account
I have asked this question in the past and did get answers but I am still struggling to figure this out. Basically, I want to export the entire structure of the given Dropbox Business account to a l...
Greg-DB
Dropbox Community Moderator
7 years ago(For anyone else interested, the earlier thread can be found here.)
Do I list this namespaces and use the namespace id as path to traverse each folder?
Yes, specifically, it sounds like you're referring to doing this by listing all namespaces across the team using /2/team/namespaces/list[/continue], which is a good way to approach this.
Would that cover all the folders that are there?
Yes, that should cover everything.
How would I de-duplicate the traversed folders?
You can use the namespace ID (e.g., "shared folder ID") to de-duplicate entries. These are consistent across users.
How do I segregate between Private, Shared and Team folders?
You can use the NamespaceType value (i.e., under NamespaceMetadata.namespace_type returned by /2/team/namespaces/list[/continue]) to check the type.
- rk907 years agoHelpful | Level 5
Thanks for the response!
Does the namespaces_list returns entries for all folders or just the top-level folders only. Listing namespace and checking the namespace_type is pretty straight forward, but as we traverse through the folders it becomes difficult to find out type of the sub-folders.
I list folders recursively, in folder listing response, I see several entries that have sharing_info which can be used to get the shared_folder_id, but I have noticed that when I list member folders, the team_folders the member has access to also gets listed and returns sharing_info. So, in that user's context the team_folder is a shared_folder. How do I deal with this situation? I also found that several folders do not return sharing_info what type of folders those are? member's personal folder? Unmounted folders also don't return info sharing_info I guess.
Also when I list namespace NamespaceMetadata.name is 'Root' for all member folders.
Lastly if the Dropbox Business account I am operating on has a team_space, then what approach should I take to list all files and folders. I want to use a consistent approach across Dropbox accounts (wheteher it has team space or not).
I would appreciate any pointers and suggestions.
I would also like to thank you for your help so far. You are a champ!
- Greg-DB7 years ago
Dropbox Community Moderator
Does the namespaces_list returns entries for all folders or just the top-level folders only.
The /2/team/namespaces/list[/continue] endpoints return a list of all of the "namespaces". This will not be a complete list of all folders. Namespaces include team folders, shared folders, team members' home folders, and team members' app folders (but not normal folders insides those folders).
To then list the contents of any particular folder, you should use /2/files/list_folder[/continue], with recursive=true if you want all nested entries as well.
in that user's context the team_folder is a shared_folder. How do I deal with this situation?
Team folders are very similar to shared folders. I'm not sure I understand your question "How do I deal with this situation?" though. Can you elaborate? What specifically is causing you trouble?
several folders do not return sharing_info what type of folders those are?
If a folder does not have sharing_info, it is not itself a shared folder, nor contained in a shared folder. (E.g., it's a private folder in a member's account.)
Unmounted folders also don't return info sharing_info I guess.
Unmounted folders aren't listed by /2/files/list_folder[/continue] anyway.
the Dropbox Business account I am operating on has a team_space, then what approach should I take to list all files and folders.
I recommend reviewing the Namespace Guide and Content Access Guide, if you haven't already, as they should offer some useful reference on this.
- rk907 years agoHelpful | Level 5
I have reviewed Namespace Guide and Content Access Guide. The namespace guide explains the difference between a team space and non-team space accounts, but is listing namespace will include all namespaces (not recursive but top-level) on both types (Team space and non-team space) of accounts?
I am still not clear on the concept of team and shared folders (I have reviewed online resources). If team folders and shared folders both have a shared_folder_id and are almost similar, then why are they identified differenty. Nevertheless, my main objective is to walk through each and every folder recursively and for that I need a list of top-level folders which I assume can be obtained by listing namespace.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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, Facebook or Instagram.
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!