Learn how to make the most out of the Dropbox Community here 💙.
Forum Discussion
joshuacole
6 years agoNew member | Level 2
get_metadata endpoint cannot find valid namespace IDs
I am currently iterating over a list of all namespace IDs from a given teamroom. When i supply these namespace IDs to the files/list_folder endpoint, I recieve a valid response of all files found wi...
Greg-DB
Dropbox Staff
6 years agoAre the namespace IDs for the team members' home folders?
By default, API calls operate using the member's home folder as the "root", but you can't retrieve the metadata for"root". So, while the folders have contents that can be listed, you can't retrieve the metadata for the folder itself.
For teams using the team space though, you can optionally set the "root" for an API call to be the team space's root, in which case you can retrieve the metadata for the user's folder under that team space root. You can find information on how to do so in the Namespace Guide here.
As a concrete example:
# given a user who is a member of a team with the "team space configuration", with these values: # "root_namespace_id": "1990815600", # "home_namespace_id": "1990696960", curl -X POST https://api.dropboxapi.com/2/files/get_metadata \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Dropbox-API-Select-User: <MEMBER_ID>" \ --header "Content-Type: application/json" \ --data "{\"path\": \"ns:1990696960\"}" # ^ this one doesn't work, since you're trying to get the metadata for the current "root" curl -X POST https://api.dropboxapi.com/2/files/get_metadata \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Dropbox-API-Select-User: <MEMBER_ID>" \ --header 'Dropbox-API-Path-Root: {".tag": "root", "root": "1990815600"}' \ --header "Content-Type: application/json" \ --data "{\"path\": \"ns:1990696960\"}" # ^ this one does work and returns the metadata for the member's folder under the team space root
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,966 PostsLatest Activity: 2 days 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!