cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i can't get the refresh_token

i can't get the refresh_token

eisoft
New member | Level 2

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 1

Greg-DB
Dropbox Staff

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?