We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
aosingh
8 years agoExplorer | Level 4
Dropbox Business API || Connected as an Admin || Path is always None
Hi,
I am using the Dropbox Business API and connecting to an account as an admin in the following way.
(Python SDK)
dbx_team = DropboxTeam(token) # For Business(Team) Accounts
admin_profile = dbx_team.team_token_get_authenticated_admin().admin_profile
dbx = dbx_team.as_admin(admin_profile.team_member_id)
Then, I list the folders as follows.
has_more = True
while has_more:
try:
if cursor is None:
result = dbx.files_list_folder(path=root_name_space,
recursive=True,
include_mounted_folders=True)
else:
result = dbx.files_list_folder_continue(cursor)
except ApiError, e:
print e
return {'error': 'DROPBOX_LIST_FOLDER_ERROR', 'description': unicode(e)}
The problem is for all Metadata types i.e. FolderMetadata, FileMetadata and DeletedMetaData, the attributes `path_lower` and `path_display` are always None.
Is there a way, that I can get the path information?
Thank you
1 Reply
- Greg-DB8 years ago
Dropbox Community Moderator
Is the `root_name_space` in your code referring to a team space?
If so, in order to access the team root using the Python SDK and get the relative paths, you'll need to use `with_path_root` like this:
dbx.with_path_root(dropbox.common.PathRoot.root(root_name_space)).files_list_folder("")Apologies this isn't better documented yet!
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!