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?