We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.
Forum Discussion
Daniel23
7 years agoExplorer | Level 4
Get message from server if a file is modified
I am looking for a way to sync the files of the App-Folder in Dropbox with the local files if a file is modified on the PC an synced. My first thought is to react to a message from the server if one is modified and then start the sync.
But can't find anything in the documentation. Do I have to check periodically if something changed in the folder or are the message to which I can react?
That's correct, you need a web server where you can receive the notifications to use webhooks. The webserver doesn't have to use Python though. That's just for the example. It can run whatever you want.
If you want a purely client-side solution, you can instead use "longpolling", to get low latency updates. There's an old blog post that explains how this works. That was written for the now-retired API v1, but the concept is the same on API v2. On API v2, the endpoint is /2/files/list_folder/longpoll. This is also implemented in the API v2 SwiftyDropbox SDK, as well as in the API v2 Objective-C SDK
- Greg-DBDropbox StaffIt sounds like you're looking for the "webhooks" feature. You can find more information here:
https://www.dropbox.com/developers/reference/webhooks- Daniel23Explorer | Level 4
Yes, I think that is it. Thank you.
But is does also work with android/java, doens't it? Because the example app is in python.
If I understand the tutorial right, I need a webapp on my own server. But I don't have something like that. I just have my native app on the phone authenticated with the acc of the user.
- Greg-DBDropbox Staff
That's correct, you need a web server where you can receive the notifications to use webhooks. The webserver doesn't have to use Python though. That's just for the example. It can run whatever you want.
If you want a purely client-side solution, you can instead use "longpolling", to get low latency updates. There's an old blog post that explains how this works. That was written for the now-retired API v1, but the concept is the same on API v2. On API v2, the endpoint is /2/files/list_folder/longpoll. This is also implemented in the API v2 SwiftyDropbox SDK, as well as in the API v2 Objective-C SDK
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 2 months agoIf 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!