Start 2025 on time and up to date. Seamlessly integrate your calendars into Dropbox with these simple steps.

Forum Discussion

gmadeira1's avatar
gmadeira1
Explorer | Level 3
7 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).