We’re aware of an issue causing slower load times on the Dropbox Community forum. It should be resolved soon. Thanks for your patience! 

Forum Discussion

AlvaroHuertas's avatar
AlvaroHuertas
Explorer | Level 3
3 years ago

How can I retrieve all my folders shared with teams in Python?

Hi!

 

I'm trying to retrieve all the folders inside my Dropbox account. In the first approach I'm just able to retrieve the info from something like my "home folder" but there is other folders that I created as the admin that are not being showed calling 'files_list_folder()' function.

 

I'm instantiating my DB account as 

 

 

dbx = dropbox.Dropbox(oauth2_refresh_token=REFRESH_TOKEN, app_key=APP_KEY)

 

 

 

I tried to use DropboxTeam like that:

 

 

dbx = dropbox.DropboxTeam(oauth2_refresh_token=REFRESH_TOKEN, app_key=APP_KEY).as_admin(ADMIN_ID)
dbx.files_list_folder("")

 

 

 

But I'm getting this error:  'dropbox.exceptions.BadInputError: BadInputError('a5c6fcd46470407982efeb801ea9c3ac', 'Error in call to API function "files/list_folder": Unexpected select user header. Your app does not have permission to use this feature')'

 

Any solutions to this?

2 Replies

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    3 years ago

    AlvaroHuertas, have you selected some team scope for your application 🤔 or not yet? Without team scope you can't use team related features even when the API call, you're using, doesn't require such scopes! In such cases the call will be rooted to the home scope and you can't change this. Keep in mind that when you change some application scope, you need to authenticate your application anew (such changes are NOT retroactive) - OAuth anew.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    3 years ago

    AlvaroHuertas Looking at the error and code, as Здравко said, it looks like you're trying to use a feature that your app is not actually configured for. For example, if your app is not team-linked, you wouldn't use as_admin.

     

    And for information on how to access the team space, check out the Team Files Guide.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with 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!