cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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 to automate keeping track of images being uploaded and resize them (24/7).

How to automate keeping track of images being uploaded and resize them (24/7).

Thang2000
Explorer | Level 4

Hi guys,
My company uploads images daily and needs an automated image resizer running 24/7. I'm getting stuck on building this functionality via Dropbox's webhook. My idea is to host a web server that will receive a notification whenever somebody uploads an image and resize them in the back end. My problem is I can't seem to find a way to let the app stay on all the time without needing to refresh the token. Please point me in the right direction since I don't even know if this is even a doable idea. How do I connect my app so that it will always be ready to make changes in dropbox?

Thank you.

1 Reply 1

Greg-DB
Dropbox Staff

Dropbox is no longer offering the option for creating new long-lived access tokens. Dropbox is now issuing short-lived access tokens, which do expire after a short period of time, and optional refresh tokens, which don't expire, instead of long-lived access tokens. You can find more information on this migration here.

Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. For long-term unattended use cases like yours, you will need to request and use a refresh token. After the initial authorization though, once you have the refresh token, you can have your app use it automatically, so that the app can perform Dropbox operations whenever needed.

 

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. Specifically, "Step 5: Retrieve a new short-lived access token" of section 2 "Using offline access" shows how to programmatically use a refresh token to get a new short-lived access token whenever.

Need more support?
Who's talking

Top contributors to this post

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