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.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

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

How can we handle if the dropbox short living accesstoken expires in the middle of the API Request?

How can we handle if the dropbox short living accesstoken expires in the middle of the API Request?

ganeshpuli3
Explorer | Level 3

How can we handle if the dropbox short living accesstoken expires in the middle of the API Request?

here the scenario totally explained :- 

 

dropbox short lived access token have expiring time is 4 hours

user logged in to the our dropbox api consuming application before 1 hour of access token expiring

and user uploading some files at before 1 minute of access token expires (i.e. at 3 hr 59 minute)

and the request is going to take 3 minutes approaximately

here in the middle of the api call or request access token expired

example :- user uploading 10 files into dropbox

after 5 files uploading, if dropbox access token expires then how can we handle this situation

(i.e how can we resume this operation of remaining 5 files uploading process into dropbox by getting new access token)

 

Thanks & Regards, 

Ganesh

1 Reply 1

Greg-DB
Dropbox Staff

You do not need to apply any special logic for the expiration of an access token near the boundary of the expiration time; the Dropbox API servers will authenticate each request and either allow or reject it. For any given API request, the request will either be authenticated and then proceed, or it will not (e.g., if the access token is expired) and the call will be rejected. The call will be authenticated at the beginning of the request, and then the file upload will proceed. As long as you receive a successful API response, then the file was uploaded. If you receive an API error, then the file was not uploaded.

 

If the call is rejected, indicating that the short-lived access token is expired, you should then get a short-lived new access token for further calls. You can do so by having the user re-authorize the app, or if your app requested "offline" access, use the refresh token to get a new short-lived access token programmatically. You can find more information in the OAuth Guide and authorization documentation.

Need more support?
Who's talking

Top contributors to this post

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