cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 

Get message from server if a file is modified

Daniel23
Explorer | Level 4

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?

1 Accepted Solution

Accepted Solutions

Re: Get message from server if a file is modified

Dropboxer
Dropboxer

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

View solution in original post

3 Replies 3

Re: Get message from server if a file is modified

Dropboxer
Dropboxer
It sounds like you're looking for the "webhooks" feature. You can find more information here:

https://www.dropbox.com/developers/reference/webhooks

Re: Get message from server if a file is modified

Daniel23
Explorer | 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.

 

Re: Get message from server if a file is modified

Dropboxer
Dropboxer

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

View solution in original post

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?