Forum Discussion

priyalcoc1's avatar
priyalcoc1
Explorer | Level 3
2 years ago

Dropbox Access Token Auto Generation

I was trying to upload my files to dropbox using api, but the thing is my token expires after few minutes.

 

Is there any way that while uploading, it checks whether the token is expired or not, and them automatically generates fresh token, because updating the token manually is a mess if you know, as my product is going to be a public product so this might be an issue.

    • priyalcoc1's avatar
      priyalcoc1
      Explorer | Level 3

      Tried this, but the thing is when I try to generate new token, it takes me to a website, and I can't access that website without email and password, so I can't share my id and pass to public na.

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app. Once the app has a refresh token, it can use it to perform the refresh process entirely automatically, without the user present and without their username and password, to get a new short-lived access token whenever needed.

         

        Please refer to the resources in my previous message for information on how to use this functionality.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers806 PostsLatest Activity: 10 hours ago
217 Following

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!