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 = dropbox.DropboxTeam("<TOKEN>");
I can list all the namespaces availables with :
for entry in dbx.team_namespaces_list().namespaces:
print(entry.namespace_id +" / "+entry.name)
When i use the team_team_folder_list() :
for entry in dbx.team_team_folder_list().team_folders:
print(entry)
I retrieve the top-level folder which is the shared workspace.
Then i want to list all the files and folder in this directory :
p = dropbox.common.PathRoot.namespace_id("<TEAM_FOLDER_ID>")
for entry in dbx.with_path_root(p).team_team_folder_list().team_folders:
print(entry)
I always get the error :
Traceback (most recent call last):
File "dropbox_hausfeld.py", line 40, in <module>
for entry in dbx.with_path_root(p).team_team_folder_list().team_folders:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dropbox/base_team.py", line 1808, in team_team_folder_list
None,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dropbox/dropbox.py", line 274, in request
timeout=timeout)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dropbox/dropbox.py", line 365, in request_json_string_with_retry
timeout=timeout)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/dropbox/dropbox.py", line 456, in request_json_string
raise BadInputError(request_id, r.text)
dropbox.exceptions.BadInputError: BadInputError('00f98974766854e558110eec5a014ed7', 'Error in call to API function "team/team_folder/list": Unexpected path root value in HTTP header "Dropbox-API-Path-Root": "{\\".tag\\": \\"namespace_id\\", \\"namespace_id\\": \\"<TEAM_FOLDER_ID>\\"}"')
Is this the good way to do it ? How can i solve the issue ?
How can i access all the files in a team dropbox ?
Thanks in advance for your help,
Thomas.