You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
trayer72
6 years agoNew member | Level 2
List content of Team forlders Within Python SDK
Hi,
I'm trying to list all the files contained in a dropbox business team folder.
I'm using the official Python SDK.
I tried to use the dropbox.DropboxTeam class.
Here is my code :
dbx...
Greg-DB
6 years agoDropbox Staff
Setting a path root isn't required or expected when calling team-level endpoints such as team_team_folder_list. It is only supported for user-level filesystem endpoints.
Further, team_team_folder_list is only for listing the team folders themselves. To list the contents of any particular folder, you should use files_list_folder and files_list_folder_continue instead. Since you have a Dropbox Business API access token, for a team, setting that up would look like this:
dbx_as_user = dropbox.DropboxTeam("<TOKEN>").with_path_root(p).as_user(member_id) dbx_as_user.files_list_folder("")
This uses as_user to set a particular user to operate as, returning a Dropbox object.
You can first get the team member ID, for the member_id value in the sample above, from various places via a DropboxTeam object, such as team_members_list/team_members_list_continue, or team_members_get_info.
You can find more information on the path root and member file access features, respectively, in the Namespace Guide and Member file access documentation.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,917 PostsLatest Activity: 11 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!