We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

dolphin automation's avatar
dolphin automation
Explorer | Level 3
4 years ago

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 

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    4 years ago

    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

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 20 hours ago
411 Following

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 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!