You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

gmadeira1's avatar
gmadeira1
Explorer | Level 3
5 months ago

Python Teams Download file

Hello,

 

I'm using Dropbox teams to download a file from a team folder.

The application was running fine but since the changes in the teams folders organization, it stopped working.

 

I'm currently trying to download the file by using the following code:

 

dbx_team = dropbox.DropboxTeam( oauth2_refresh_token=refresh_token, app_key=APP_KEY, app_secret=APP_SECRET )

myuser = dbx_team.as_user('dbmid:*****************')

file =myuser.files_download_to_file("PATH TO STORE LOCALLY","SOURCE FILE")

 

However, I'm getting the following error:

BadInputError('df3e1ee38a834a5c99e916817cf00d66', 'Error in call to API function "files/download": Invalid select user id format')

 

Can you clarify how should I setup this?

 

 


  • gmadeira1 wrote:

    ... Could it be related to that?


    Hi gmadeira1,

    No. It could be related to where you got that id from and how. Can you clarify? Also, try forget your first (troublesome) user identifier and get it in the same way as you have done for the second. Is it still troublesome?

    Hope this gives direction.

     

    PS: To access some team folder in shared team space, you would need to set/change your path root too. Skipping this step would restrict you to member home/private folder/namespace (something assumed when nothing else set).

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    That error message is indicating an issue with the member ID you supplied when specifying which team member to operate on. In this case, that would be the value you're supplying to the "as_user" method. I see you indicated you're supplying a value that starts with "dbmid:", which would be correct, but you redacted the rest of the value.

     

    Please double check that you're supplying the correct value for a current member of the team there. You can get team member IDs from various methods on the API, such as team_members_get_info_v2, team_members_list_v2/team_members_list_continue_v2, etc.

     

    If you're supplying a valid value, please feel free to open a ticket here and share the code with the unredacted member ID value so we can look into it for you.

    • gmadeira1's avatar
      gmadeira1
      Explorer | Level 3

      Hello, 

      I managed to get it working using a different user.

      With the user I was previously using, it always gives the mentioned error.

      The user that is having problems is an admin account. Could it be related to that?

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

        gmadeira1 wrote:

        ... Could it be related to that?


        Hi gmadeira1,

        No. It could be related to where you got that id from and how. Can you clarify? Also, try forget your first (troublesome) user identifier and get it in the same way as you have done for the second. Is it still troublesome?

        Hope this gives direction.

         

        PS: To access some team folder in shared team space, you would need to set/change your path root too. Skipping this step would restrict you to member home/private folder/namespace (something assumed when nothing else set).

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,882 PostsLatest Activity: 3 years ago
325 Following

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 or Facebook.

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!