Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
jgriffo1
4 years agoNew member | Level 2
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', ap...
Greg-DB
Dropbox Community Moderator
4 years ago[Cross-linking for reference: https://stackoverflow.com/questions/71955472/how-do-i-automate-retrieval-of-a-refresh-token-using-the-dropbox-python-3-x-api ]
Dropbox API refresh tokens do not expire after four hours. They can be revoked on demand, but they do not expire automatically, and can be stored and re-used repeatedly. (The short-lived access tokens themselves do expire, but the refresh token can be used to get new short-lived access tokens whenever needed. The official Dropbox SDKs will do that process for you automatically.)
So, while you do need to manually process the app authorization flow once to get a refresh token, once you have it, you can store and re-use it for long-term access without further manual interaction.
jgriffo1
4 years agoNew member | Level 2
Thank you for your response. I think my confusion came from the JSON that had an expiry field on it:
{
"access_token": "www",
"token_type": "bearer",
"expires_in": 14400,
"refresh_token": "xxx",
"scope": "account_info.read files.content.write files.metadata.read files.metadata.write",
"uid": "yyy",
"account_id": "zzz"
}
- Greg-DB4 years ago
Dropbox Community Moderator
I see, thanks for the context. That expiration only applies to the access token. You can find more information on each field in the documentation here.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!