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: 

Get message from server if a file is modified

Get message from server if a file is modified

Daniel23
Explorer | Level 4
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution
It sounds like you're looking for the "webhooks" feature. You can find more information here:

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

Daniel23
Explorer | Level 4
Go to solution

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-DB
Dropbox Staff
Go to solution

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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Daniel23 Explorer | Level 4
What do Dropbox user levels mean?