cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Python SDK DropboxTeam.as_user throws BadInputException app_key is required to refresh tokens

Python SDK DropboxTeam.as_user throws BadInputException app_key is required to refresh tokens

ronalddy1
New member | Level 2
dbx_t = dropbox.DropboxTeam(
    oauth2_refresh_token=refresh_token, 
    app_key=app_key, 
    app_secret=app_secret 
) 
admin = dbx_t.team_token_get_authenticated_admin()
dbx_t.as_user(admin.admin_profile.team_member_id)

this raises

File "venv/lib/python3.6/site-packages/dropbox/dropbox.py", line 715, in as_user
    team_member_id)
File "venv/lib/python3.6/site-packages/dropbox/dropbox.py", line 739, in _get_dropbox_client_with_select_header
    headers=new_headers,
File "venv/lib/python3.6/site-packages/dropbox/dropbox.py", line 185, in __init__
    raise BadInputException("app_key is required to refresh tokens")
dropbox.dropbox.BadInputException: app_key is required to refresh tokens

Am I using DropboxTeam.as_user incorrectly?

I looked into the code at dropbox/dropbox.py line 739. It seems like the app_key and app_secret arguments are not passed to the new Dropbox instance.

1 Reply 1

Greg-DB
Dropbox Staff

[Cross-linking for reference: https://github.com/dropbox/dropbox-sdk-python/issues/213 ]

 

Thanks for the report! I'll follow up with you on the GitHub issue.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?