Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
VahagnGhaz
7 years agoExplorer | Level 3
How to provide the Dropbox-API-Select-User HTTP header with python API
Hi ! I've generated access token for Business App, and tried to make simple request
dbx = dropbox.Dropbox(my_token) dbx.files_list_folder(path).entries
But I got
dropbox.exceptions.BadInput...
VahagnGhaz
7 years agoExplorer | Level 3
Thanks for your reply. Everything works fine, but now I have another issue. All I need to list, write ... in TEAM shared folder, but when I use
self.dbx.files_list_folder(self.path).entries
I got ['Get Started with Dropbox Paper.url', 'Get Started with Dropbox.pdf'], which is my private folder content. So is there any way to access shared folder ?
Greg-DB
Dropbox Community Moderator
7 years agoBy default, API calls will operate in the private team member folder. It sounds like you want to access the team space though. To do so, you need to set the "path root" for the API call to be the team space.
I recommend reading the Namespace Guide, which covers this in detail.
In the Python SDK in particular, to specify a particular root, you should use with_path_root. For example:
dbx.with_path_root(dropbox.common.PathRoot.root("XXXXXXXXX")).files_list_folder("")
or:
dbx.with_path_root(dropbox.common.PathRoot.namespace_id("XXXXXXXXX")).files_list_folder("")
- VahagnGhaz7 years agoExplorer | Level 3
I got :: > dropbox.exceptions.PathRootError: PathRootError('2f7ac7e2ce9abb921272552f987f63b3', PathRootError('no_permission', None)),
when try to run this command, so for permission do I need to make business app?
self.dbx.with_path_root(dropbox.common.PathRoot.namespace_id("2")).files_list_folder("")
- VahagnGhaz7 years agoExplorer | Level 3
Actuall I have this structure, and all I need to do is work with shared ELEMENTS folder
- VahagnGhaz7 years agoExplorer | Level 3
Okay! I got that ! thanks for your support. Just in case someone has this issue too, here is my solution
dbx = dropbox.Dropbox(my_token)
root_namespace_id = dbx.users_get_current_account().root_info.root_namespace_id
dbx = dbx.with_path_root(PathRoot.namespace_id(root_namespace_id))
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!