Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

aosingh's avatar
aosingh
Explorer | Level 4
8 years ago
Solved

List all files & folders in the root namespace for a user.

My aim is to list all the folders/files that belong to a user's dropbox account. 

 

My test user has 2 name-spaces as shown below:

root_namespace_id=u'XXXXXXXX', home_namespace_id=u'XXXXXXXXX')

  

 

The method files_list_folder takes in a path argument in which I pass the namespace id 'ns:XXXXXXX'

 

For root_namespace_id, I get the below error

ApiError('', ListFolderError(u'path', Looked(u'not_found', None)))

 

For home_namespace_id, it returns the files in the home namespace, but I do not get the Team files/folders(which belong to the root namespace).

How can I get team files/folders?

 

Thank you

 

 

  • In order to access the team root using the Python SDK, you'll need to use `with_path_root` like this:

    dbx.with_path_root(dropbox.common.PathRoot.root("XXXXXXXXX")).files_list_folder("")

    Apologies this isn't better documented yet!

3 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    8 years ago

    In order to access the team root using the Python SDK, you'll need to use `with_path_root` like this:

    dbx.with_path_root(dropbox.common.PathRoot.root("XXXXXXXXX")).files_list_folder("")

    Apologies this isn't better documented yet!

  • aosingh's avatar
    aosingh
    Explorer | Level 4
    8 years ago
    Thank you Greg, for your reply, I will test this and let you know if this works.

    Regards.
  • aosingh's avatar
    aosingh
    Explorer | Level 4
    8 years ago

    This works as expected. 

     

    Thank you Greg. 

About Dropbox API Support & Feedback

Node avatar for 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!