You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Thang2000's avatar
Thang2000
Explorer | Level 4
2 years ago

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

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.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox 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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,915 PostsLatest Activity: 4 hours ago
333 Following

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 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!