cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dropbox Business API || Connected as an Admin || Path is always None

Dropbox Business API || Connected as an Admin || Path is always None

aosingh
Explorer | Level 4

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 1

Re: Dropbox Business API || Connected as an Admin || Path is always None

Greg-DB
Dropboxer

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!

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?