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

foxo1's avatar
foxo1
Explorer | Level 4
4 years ago

Python SDK: refresh_access_token() and check_and_refresh_access_token() need app_key and app_secret

I only found after experimenting around and re-reading the OAuth guide (https://developers.dropbox.com/de-de/oauth-guide) that the Python SDK functions mentioned in the title need the app_key and app_secret to check and refresh access_tokens.

 

 

 

dbx = dropbox.Dropbox(
    oauth2_access_token=MYTOKEN,
    oauth2_access_token_expiration=MYEXPIRATION, 
    oauth2_refresh_token=MYREFRESHTOKEN, 
    app_key=MY_APP_KEY, 
    app_secret=MY_APP_SECRET
    )

 

 

...is the only way those functions would work.

 

I tried plenty of times just with the bare access_token and combinations of the above. If you look at the API documentation one can see that this is needed but for me, as a beginner in Python and especially with close to zero knowledge about the Dropbox Python SDK, it would have been easier if the documentation was a little bit more elaborate about mandatory class attributes.

 

Anyway besides that little "complaint" I really enjoy the SDK and want to congratulate you for this overall amazing product

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

    Thanks for the feedback! I'll share this with the team to see if we can improve the SDK documentation around this.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 3 days ago
333 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!