We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
journeymigration
4 years agoHelpful | Level 5
Retrieve thousands of files and folders without throttling
I'm trying to generate a nice big array for each user that contains all the files and folders the user owns as well as the users that each file/folder is shared with (e.g. users: ["John Doe": [{"name...
Greg-DB
Dropbox Community Moderator
4 years ago[Cross-linking for reference: https://stackoverflow.com/questions/74813769/retrieve-thousands-of-files-and-folders-without-throttling ]
It sounds like you have the right idea here, though be sure to use batch options/endpoints whenever possible. For instance, use recursive:true on /2/files/list_folder and then page through with /2/files/list_folder/continue instead of recursing for each folder yourself. Also, you can use /2/sharing/list_file_members/batch to get the members of multiple files at once.
Also, you may want to start from /2/team/namespaces/list and /2/team/namespaces/list/continue to iterate over and list unique namespaces (such as team member folders, shared folders, etc.) as that may be more efficient than working from the member list.
And for reference, the Dropbox API does have a rate limiting system, but if/when you do hit it, the back-off period is generally only on the scale of seconds/minutes, so that hopefully wouldn't be too disruptive if you do run in to that. You can find more information in the error documentation and Error Handling Guide.
journeymigration
4 years agoHelpful | Level 5
If I used the /2/team/namespaces/list and /2/team/namespaces/list/continue endpoints how would I know who owns the folder and the files within the folder (and their owners)?
- Greg-DB4 years ago
Dropbox Community Moderator
For team member folders, the /2/team/namespaces/list and /2/team/namespaces/list/continue results include the relevant team_member_id in the NamespaceMetadata object.
For shared folders, you can still use /2/sharing/list_folder_members and /2/sharing/list_folder_members/continue to list the shared folder's members and owner. (And content within a shared folder that isn't itself specifically shared doesn't have an owner distinct from its parent shared folder.)
- journeymigration4 years agoHelpful | Level 5
On initial glance, the namespaces array is returning objects like the following:
{"name": "*****","namespace_id": "*****27","namespace_type": {".tag": "shared_folder"}},{"name": "*** Test","namespace_id": "*****92","namespace_type": {".tag": "team_folder"}}The exception is when "name": "Root". Is there a reason the other objects don't include the team_member_id?- journeymigration4 years agoHelpful | Level 5
Also for /2/sharing/list_file_members/batch, if I understand correctly this will only list members that are different from the inherited sharing of the parent folder. If I call the batch endpoint I'm getting an array of empty results, like so:
"file": "id:****","result": {".tag": "result","members": {"users": [],"groups": [],"invitees": []},"member_count": 0}However, if I call the /2/sharing/list_file_members endpoint (using just one file id, of course) I get each member and their access type. The problem with the batch approach is how do I know who are the members and owner of each file then?
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!