cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

refresh token

refresh token

Goldmine
Explorer | Level 3

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 2

Здравко
Legendary | Level 20

@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.

Greg-DB
Dropbox Staff

@Goldmine In addition to the information Здравко provided, you can find more resources on this at the following links:

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?