Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
pchui
5 months agoNew member | Level 2
Dropbox API Inquiry
I have to query the Dropbox Search API with a Team access token (i.e. scope team_data.member enabled). I learned that I have to include the 2 HTTP headers in the search API for my use case to work properly:
Dropbox-API-Select-User: dbmid:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Dropbox-API-Path-Root: {".tag": "namespace_id", "namespace_id": "XXXXXXXXXXXX"}
That implies I have to call /users/get_current_account for every search API call unless I cache those values.
Is there any way I can bypass putting these headers? Why can't Dropbox API extract the user ID via the access token instead? That's an OAuth2 standard.
I have to enforce the file search in both user and team folders, hence specifying Dropbox-API-Path-Root. By answering the following questions, it will help me if I can hardcode this namespace_id for my use case:
- Is it possible for an organization/user to have multiple Dropbox teams?
- Is it possible for an organization to have multiple namespace_id? How is a namespace and team correlate to each other?
- When two different users in the same organization logged into Dropbox, is it possible they can have different root_namespace_id when they call /users/get_current_account?
3 Replies
- DB-Des4 months ago
Dropbox Community Moderator
Hi pchui
It isn't currently possible to bypass adding "Dropbox-API-Select-User" and "Dropbox-API-Path-Root" where needed, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
As far as your other questions go:
Is it possible for an organization/user to have multiple Dropbox teams?
Feel free to reference the following article for more information on multi-teams: https://blog.dropbox.com/topics/product-tips/multi-team-admin
Is it possible for an organization to have multiple namespace_id? How is a namespace and team correlate to each other?
An organization can have multiple namespace_id values.
To further clarify what namespaces are: Each user’s private Dropbox folder maps to a root namespace. Shared folders are also mapped to their own namespaces, as are team folders in Dropbox Business and Dropbox Enterprise. Namespaces are also where we set ownership and access permissions. A user has the same access type for all of the files and folders in a namespace.
You can find more information here: https://developers.dropbox.com/dbx-team-files-guide
When two different users in the same organization logged into Dropbox, is it possible they can have different root_namespace_id when they call /users/get_current_account?
Two different users will have different root_namespace_id when /2/users/get_current_account is called for each respective user.
- pchui4 months agoNew member | Level 2
Thanks for the answers. They are helpful.
A follow-up question:
- Can a regular user (not an admin) get access files/folders located in multiple Teams with the same email address? Otherwise, he/she needs to login and logout whenever he/she needs to get files in another team.
- DB-Des4 months ago
Dropbox Community Moderator
To clarify, only team admins can authorize apps with team-level scopes.
That said, you can configure API calls to operate in the "team space", in order to interact with files/folders in the team space. To do so, you'll need to set the "Dropbox-API-Path-Root" header. You can find information on how to use this in the Team Files Guide.
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!