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: 

How to automatically generate an access code using the Dropbox API (Python)

How to automatically generate an access code using the Dropbox API (Python)

musidelics_0
New member | Level 2

I am currently working on a Python program where I automatically upload generated videos to Dropbox using the API and run the program on the cloud (so it's 100% required that it's 100% automated), but I can't seem to find a way to automatically generate new access tokens when the old one expires.

 

The only method I seem to find involves doing it manually, which I can't afford. How do I solve this?

2 Replies 2

Здравко
Legendary | Level 20

@musidelics_0 wrote:

..., but I can't seem to find a way to automatically generate new access tokens when the old one expires. ...


You don't need to explicitly 'generate new access tokens'. The only thing you need is using refresh token on client object building and... that's it. 😉 You can continue use it as you are doing now (the object itself will take care for the 'generation').

Hope this helps.

Greg-DB
Dropbox Staff

@musidelics_0 Здравко is correct. You can use a refresh token to automatically get new short-lived access tokens. For instance, if you're using the official Dropbox Python SDK, and supply the necessary credentials, e.g., as shown in this example, the SDK will handle the refresh process for you automatically.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?