We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.
Forum Discussion
dolphin automation
3 years agoExplorer | Level 3
Access token keeps expiring after few hours
We use Dropbox API as follows
https://api.dropboxapi.com/oauth2/token
"grant_type" => "authorization_code",
"code" => code,
"redirect_uri" => redirect_uri,
We receive access_token, but after few hours they expire and user again has to go through Authorizaion process.
We read about refresh token. How can refresh tokens be used to retrieve short live token so that user does not have to go through authorization process. We use rudy SDK. It would be great if you can provide some sample code to use refresh token
- Greg-DBDropbox Staff
Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find more information on this migration here.
Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the OAuth Guide and authorization documentation. You can find an example of using a refresh token to get a new short-lived access token, without manual interaction, here, under "Example: refresh token request".
For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any. Also, note though that after the change you won't be able to create new long-lived access tokens.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 2 years agoIf 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!