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

Forum Discussion

Goldmine's avatar
Goldmine
Explorer | Level 3
3 years ago

refresh token

I had integrated drop box in php and its file uploaded successfully, But there is issue of access token which available for short time. How to generate refresh token for it and integrate in php.

2 Replies

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    3 years ago

    Goldmine wrote:

    I had integrated drop box in php and its file uploaded successfully, But there is issue of access token which available for short time. How to generate refresh token for it ...


    Hi Goldmine,

    All new access tokens are short lived (~4 hours typically). As you found out, refresh token can be used to achieve long term access. You can generate such token by hand using procedure like the one, described here. Checked and working. 😉

     


    Goldmine wrote:

    ... and integrate in php.


    You need to integrate in your php code only the last step, described there (i.e. the refresh step). You have to keep track for the expiration moment (calculated as refresh moment plus "expires_in" time), for every single access token, and when current time passes this expiration moment and you need to perform some API call, refresh the access token as described. It's easier instead of using access token as constant to implement accessor function and use it whenever you're using your token at present, so will be able track the needed refresh moment.

    Hope this helps.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers814 PostsLatest Activity: 11 months ago
274 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!