You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
CHBA
2 years agoExplorer | Level 3
Does the Acces token expire?
I am using Google Apps script to create a PDF file. This is stored in my Google Drive. Yesterday I added to the script that I need a copy of new PDF files send to dropbox. Below is the script I a...
Greg-DB
2 years agoDropbox Staff
CHBA Здравко is correct; Dropbox is no longer offering the option for creating new long-lived access tokens. Dropbox is now issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find more information on this migration here. This is not related to the plan (i.e., free or not) on your account.
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. There's a basic outline of processing this flow in this blog post which may serve as a useful example. Note that it is not possible to use the "Generate" button to get a refresh token. That button will only create short-lived access tokens. You would need to use the OAuth app authorization flow to get a refresh token.
When using the OAuth app authorization flow, note that the "authorization code" (sometimes called "access code") is different than access tokens and refresh tokens. Authorization codes can each only be used once, and are only valid for a short period of time, to complete the authorization flow.
We do recommend using one of the official Dropbox SDKs whenever possible. For examples of implementing this with the Dropbox JavaScript SDK, for instance, please refer to the examples included in the "examples" folder in the SDK. As long as you set the app key (a.k.a. client ID) and refresh token, like shown in this example for the JavaScript SDK, the SDK will actually handle refresh process for you automatically. The SDK will automatically catch expired access token errors and call the API to get a new short-lived access token when needed. Refresh tokens don't expire (though they can be revoked on demand), so if this is only for your own account, you would only need to get a refresh token for your own account once and could re-use that.
If something isn't working as expected, please share the steps/code to reproduce the issue, and the error or unexpected output you get.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,911 PostsLatest Activity: 7 hours 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!