Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I have a serverless function that accesses a Dropbox app folder using the access token generated in the app console to downloads files. It is triggered through a push notification from Dropbox. This happens in the background with no user interaction. I have been developing using my own Dropbox account and have had no problem with the token expiring. I've now switched to a different gmail email address used by the project I'm developing for and created an app in the same way. This time I get a token prefixed with 'sl' that expires. I've followed the instructions here: https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Tokens-only-valid-for-4-hours-from-app-... But still get an 'sl' prefixed token that expires. Please can anyone advise why I'm getting different types of tokens between the 2 accounts and how to get a long life token? Alternatively, is there any way to refresh a token through a serverless function. Many thanks.
You can get a refresh token via the OAuth app authorization flow and store and re-use that server-side without any further manual user interaction if you wish.
As for the short-lived access token you're getting, it sounds like you may be using the "Generate" button. That only enables you to easily get access tokens, not refresh tokens. If you do want a long-lived access token from that, you'd need to set the "Access token expiration" setting to "No expiration" before generating the access token.
In any case, I recommend first reading the OAuth Guide and authorization documentation for reference first to see how these work. If something then isn't working as expected, please post here to show the part that isn't working and we'll be happy to take a look. For instance, post the code and unexpected output, etc. Don't post any access/refresh tokens or app secrets themselves though.
You can get a refresh token via the OAuth app authorization flow and store and re-use that server-side without any further manual user interaction if you wish.
As for the short-lived access token you're getting, it sounds like you may be using the "Generate" button. That only enables you to easily get access tokens, not refresh tokens. If you do want a long-lived access token from that, you'd need to set the "Access token expiration" setting to "No expiration" before generating the access token.
In any case, I recommend first reading the OAuth Guide and authorization documentation for reference first to see how these work. If something then isn't working as expected, please post here to show the part that isn't working and we'll be happy to take a look. For instance, post the code and unexpected output, etc. Don't post any access/refresh tokens or app secrets themselves though.
Many thanks @Greg-DB , much appreciated
Hi there!
If you need more help you can view your support options (expected response time for a 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!