Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I am trying to find the possible ways to get all the 1) Personal files and folder 2) team folder and files 3) Anything shared with the user. Basically a complete snapshot of what the particular user has access to with in the business account.
After reading through the documentations, looks like I need to following steps.
Is there any other simple way which will give me all the data that user has and also has access to?
For all of the below, I will be using 'Dropbox-API-Select-Admin' as one of the headers so that it has access to any user account with in the business account.
For business accounts, here is the flow for getting the data
from dropbox
1. namespaces (team/namespaces/list)
2. members (team/members/list)
To get the full data of a particular user,
1. Find the 'member_folder_id' of the user from
'members' api
2. Use that value as namespace id 'ns:member_folder_id' in the
header path.
3. From the 'namespaces' find all the 'shared_folder' where
this particular user is a member by calling
['sharing/list_folder_members' and by group APIs where user
can be a member]
It sounds like for what you're trying to do, the basic outline would look like this:
Lusil
Community Moderator @ Dropbox
dropbox.com/support
Did this post help you? If so, please give it a Like below.
Still stuck? Ask me a question!
Tips & Tricks Find new ways to stay in flow or share your tips on how you work smarter with Dropbox.
Thanks for reply.
Looks like that doesn't work for me. My app has 'Team member file access'. When I try the below,
POST /2/files/list_folder
Host: https://api.dropboxapi.com
Authorization: Bearer <token>
Content-Type: application/json
Dropbox-Api-Select-User: dbmid:
{
"path": "",
"recursive": true
}
I get only the list of files from the user and nothing from team folders.
@searchx It sounds like the team probably uses the "team space" configuration, so the team folders aren't mounted inside the member's own folder. You'll need to use the "Dropbox-API-Path-Root" header to identify the team space in that case. The Namespace Guide goes over this in detail:
https://www.dropbox.com/developers/reference/namespace-guide
Thanks Greg.
It is still confusing. Let me re-iterate my problem.
I have an Admin token and I would like to see all the files that user has access to ( Private, team and shared). Accoding to the team space concept, in order to do that, I need to first find out all the name space ids and make calls (list/list_folder) for each?
Or is there a way, that I can make single (list_folder/continue) call as described in the documentation 'Dropbox-API-Select-User' ?
If there is a way, what combination of headers( Dropbox-API-Select-User andDropbox-API-Path-Root) I should use?
It sounds like for what you're trying to do, the basic outline would look like this:
Thank you!
This works perfect! From my testing, I notice is that, the last item itself gives me everything. Step3 looks redundant.
Only difference between both the methods is how path_lower returned for 'Private' and 'Shared' items and which makes sense based on what set as root.
If anyone else looking for the same, final snippet of what I used for finding all the 'Private', 'Shared' and 'Team' content of what each user has access to with in the business account.
path = {".tag": "root","root":"namespace_id of team_folder"}
headers = {
"Authorization": "Bearer " + self.access_token,
"Content-Type": "application/json",
"Dropbox-API-Path-Root": json.dumps(path),
"Dropbox-API-Select-User": "dbmid:....."
}
data = {
"path": "",
"recursive": True
}
Hi there!
If you need more help you can view your support options (expected response time for a 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!