We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
eisoft
3 years agoNew member | Level 2
i can't get the refresh_token
my aceess token has expired 😞
and i can't get the refresh_token
I'm trying to backup to dropbox using access token via curl on linux. However, the access token automatically expires after about 5 hours, and renewal access codes cannot be issued.
I checked using the code below. But still refresh_token is not visible.
curl https://api.dropbox.com/oauth2/token \ -d code=<AUTHORIZATION_CODE> \ -d grant_type=authorization_code \ -d redirect_uri=<REDIRECT_URI> \ -u <APP_KEY>:<APP_SECRET>
This is the code result. refresh_token could not be found.
{"access_token": "MYACCESSCODE", "token_type": "bearer", "expires_in": 14400, "scope": "account_info.read files.content.read files.content.write files.metadata.read files.metadata.write sharing.read sharing.write", "uid": "MYIUIDCODE", "account_id": "dbid:MYDBID"}
how can i get the refresh_token?
1 Reply
- Greg-DB3 years ago
Dropbox Community Moderator
In order to get a refresh token, you need to request "offline" access when starting the app authorization flow, which you can do by setting 'token_access_type=offline' on /oauth2/authorize.
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.
About Discuss Dropbox Developer & API
Make connections with other developers
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!