cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right 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: 

Re: Python Teams Download file

Python Teams Download file

gmadeira1
Explorer | Level 3

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?

 

 

1 Accepted Solution

Accepted Solutions

Здравко
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).

View solution in original post

4 Replies 4

Greg-DB
Dropbox 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
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?

Здравко
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).

Greg-DB
Dropbox Staff

@gmadeira1 Здравко is correct; valid team member IDs for admins should work as well, so it sounds like you had an invalid value.

 

And for information on accessing the team space, refer to the Team Files Guide.

Need more support?