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

jgriffo1's avatar
jgriffo1
New member | Level 2
3 years ago

How can I automate retrieval of a refresh token using the Python API?

I have a Python app that is intended to run as a scheduled job to save files to Dropbox at regular intervals.  When I have a refresh token, this works fine:

dbx = dropbox.Dropbox(app_key='xxx', app_secret='yyy', oauth2_refresh_token='zzz')

 

But of course, the token only lasts for four hours. Every example I've found (here and here) all lead to answers that require a manual login to retrieve a refresh token. That will not help me to automate this job.

 

What can I do to get some sort of "long running" token or to be able to automatically generate refresh tokens without having to log in manually?

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,915 PostsLatest Activity: 5 hours 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!