Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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 within that namespace, so the namespace ID is valid. However when i supply the same namespace ID to the files/get_metadata endpoint, I receive a 409 response with the following message:
'{"error_summary": "path/not_found/.", "error": {".tag": "path", "path":{".tag": "not_found"}}}
Why can the files/listfolder successfully find the folder using the namespace id as a path, but the files/get_metadata endpoint cannot? The documentation states that namespace IDs should be valid paths when supplied to the get_metadata endpoint:
path String(pattern="(/(.|[\r\n])*|id:.* )|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.* )?)") The path of a file or folder on Dropbox.
Are 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
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!