Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
GopalN
6 years agoExplorer | Level 4
Not able to get team folders or files using python sdk
Python SDK, Not Able to get files and folders where I'm using dropbox business API access token
output = dbx.DropboxTeam(_dropbox_token).as_admin(ng_member_id).files_list_folder("").entries ...
- 6 years ago
What is the value of your '_team_name_space_id' variable?
Based on the error output you shared, if you want to list the contents of the team space, you should set your '_team_name_space_id' variable to "5632093280".
mukesh111
4 years agoNew member | Level 2
output = dropbox.DropboxTeam(TOKEN).with_path_root(dropbox.common.PathRoot.root(team_space_namespace_id)).as_admin(member_id).files_list_folder("").entries
what is the team_space_namespace_id here? I use a 10-digit number
Traceback (most recent call last):
File "/home/mukesh/Documents/automation/app_test/dropbox/test_dropbox.py", line 20, in <module>
output = dropbox.DropboxTeam(TOKEN).with_path_root(dropbox.common.PathRoot.root(team_space_namespace_id)).as_admin(member_id).files_list_folder("").entries
File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/base.py", line 2145, in files_list_folder
r = self.request(
File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/dropbox_client.py", line 326, in request
res = self.request_json_string_with_retry(host,
File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/dropbox_client.py", line 476, in request_json_string_with_retry
return self.request_json_string(host,
File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/dropbox_client.py", line 596, in request_json_string
self.raise_dropbox_error_for_resp(r)
File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/dropbox_client.py", line 643, in raise_dropbox_error_for_resp
raise PathRootError(request_id, err)
dropbox.exceptions.PathRootError: PathRootError('b0bc4fd1e82647deae8616b37255c2cc', PathRootError('invalid_root', TeamRootInfo(home_namespace
Здравко
4 years agoLegendary | Level 20
Hi mukesh111,
Take a look on Greg's post on this page top. There is pretty clear where 'team_space_namespace_id' comes from. Try reproduce something similar. 😉 One more thing, at present access token is 'short lived' only. If you need long term access, refresh token may be object of consideration from your side.
Hope this helps.
- mukesh1114 years agoNew member | Level 2
Thanks for the reference it helped. I see that there are solutions to download files are recreate the whole structure and downloading them. Is there a single function that can handle downloading a complete directory
ex: I want to download a whole FolderA with (subfolder1, subfolder2, subfolder3)
I could only find the below for files is there for folders by any chance?:
dbx_admin_team_root.files_download_to_file()- Здравко4 years agoLegendary | Level 20
Hi again mukesh111,
You can download a folder as zip file. You can use the zip stream using files_download_zip and unzip the content on fly or save it as file using files_download_zip_to_file. 😉
Good luck.
About Discuss Dropbox Developer & API
Make connections with 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!