Take Your Search Game to the Next Level with Dropbox Dash 🚀✨ Curious how it works? Ask us here!
Forum Discussion
time4116
7 years agoExplorer | Level 4
Download data for all users on team
What is the best way to download the contents of all user folders? I've created a DropBox API application but this seems to only allow access to my content, I've also created a DropBox Buisness API (Team member file access) app to see if we can leverage that to download all of our users content. However, I can't seem to find a direct way to do it via the HTTP documentation. We are mainly looking for content that is not a part of a team or shared so we can download to a local box for analyzation. Ideally, any soultion that does not require user intervention. Any tips or pointers would be greatly appreciated!
To download all non-team and non-shared file content from all members of a team without individual user action, you'll need a Dropbox Business API app with the "team member file access" permission. This will let you use the "Member file access" feature to access each member's account.
The basic outline of the code would go like this:
- Call /2/team/members/list[/continue] to get all of the members.
- For each desired member, use the "Member file access" feature to call /2/files/list_folder[/continue] with path="" and recursive=true to get the full file/folder listing for the member. (Note that this will include anything mounted inside the member's Dropbox, e.g., shared folders or mounted team folders, so you'd have to filter those out, and you may get duplicates across members, e.g., from shared folders.)
- For every desired file for each member, use the "Member file access" feature to call /2/files/download to download the file.
Alternatively, you can use /2/team/namespaces/list[/continue] instead of listing each member and then listing everything for each member.
3 Replies
Sort By
- Greg-DB
Dropbox Staff
To download all non-team and non-shared file content from all members of a team without individual user action, you'll need a Dropbox Business API app with the "team member file access" permission. This will let you use the "Member file access" feature to access each member's account.
The basic outline of the code would go like this:
- Call /2/team/members/list[/continue] to get all of the members.
- For each desired member, use the "Member file access" feature to call /2/files/list_folder[/continue] with path="" and recursive=true to get the full file/folder listing for the member. (Note that this will include anything mounted inside the member's Dropbox, e.g., shared folders or mounted team folders, so you'd have to filter those out, and you may get duplicates across members, e.g., from shared folders.)
- For every desired file for each member, use the "Member file access" feature to call /2/files/download to download the file.
Alternatively, you can use /2/team/namespaces/list[/continue] instead of listing each member and then listing everything for each member.
- time4116Explorer | Level 4
Thanks Greg! This is perfect.
It looks like the /files/download method ignores team folders as far as the ability to download or recurse.? If so, I may not need to worry about excluding folders, but Is there a way to do it via /files/list_folder?
- chirstius
Dropbox Staff
Hey time4116,
There's no direct way currently to exclude them via the initial call to /files/list_folder, but if you use /team/namespaces/list[/continue], you can filter the NamespaceMetadata that comes back on its "namespace_type" attribute. You could alternatively call /team/team_folder/list[/continue] and just use that list as a guide to filter entries from /files/list_folder[/continue]
Hope that helps,
-Chuck
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,000 PostsLatest Activity: 9 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!