Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi,
We are creating app and generating token by clicking on Generate button, it is always getting expired and we need to generate new one. we are creating app in app console (https://www.dropbox.com/developers/apps) and generated tokens always starts with "sl."
Hi @sunilgeechoo,
Using long lived access token is deprecated and creation of new is already dropped. That's why you're getting short lived token only. Alternative for long term access is refresh token. You have to adapt your application to use such token type. For possible way of refresh token creation, take a look on https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/td-p/5....
Hope this helps.
Hi,
Do i need to create tokens every time after it get expired? We are using it for display images and files in our application. Each time should we create new tokens?
No, refresh token doesn't expire itself. It's long lived and can only be revoked by the application or by user on demand.
Hi,
after generating refresh token using below
https://www.dropbox.com/oauth2/authorize?token_access_type=offline&response_type=code&client_id=<App key>
after few minutes i tried to generate access token using curl php, but it is showing string(90) "{"error": "invalid_grant", "error_description": "code has expired (within the last hour)"}"
Hi ageing @sunilgeechoo,
I'm not sure what actually you have done, but if you stopped after browser generated code... it's just a code, not refresh token, as you might thought. This code can be used one time for refresh token generation and for nothing else! As seems you haven't done it or trying multiple times (I speculate here).
To discuss your issue, present passed workflow, you have done, in more consistent way so to be clear what's the actual state and what can be done next. Maybe would be helpful exact sequence of steps up to refresh token generation (they are 2 actually) and a code snippet showing the place where you get error. Most probably you have moved second step for refresh token generation in your regular application code flow, something erroneous if unintentional. Make a note that I grouped my post, referred before, in paragraphs. Don't split commands residing in one paragraph.
Hope this gives additional direction.
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!