We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
sl4677
9 years agoExplorer | Level 3
Java example to find recent updates (without having to poll) using webhook notification
Do you have an example in Java that selects recent adds/deletes to a dropbox folder do doesn't require polling? The examples that I pulled from Github do contain one that uses a loop that continu...
Greg-DB
Dropbox Community Moderator
9 years agoI don't believe we have any examples quite like that for the API v2 Java SDK, but I'll be happy to help with any issues you're running in to.
The basic idea is that you can call listFolder and listFolderContinue initially until hasMore is false to get the initial state. Then, you can listFolderContinue for the relevant user when you get a webhook notification for them. At each call, you should re-use the latest cursor you had for that user, and then store the new one. That lets you retrieve only the new entries.
There's more information on processing these in the documentation here:
When using webhooks, you would trigger the subseqeuent listFolderContinue calls from your webhook URI handler, (as opposed to a long poll loop). There are some best practices covered here:
https://www.dropbox.com/developers/reference/webhooks
If you're having any trouble with any particular methods, please share the details (the code you're using, any errors you're getting, etc.) and I'll take a look.
sl4677
9 years agoExplorer | Level 3
Thanks for your prompt response Greg.
I'll be discussing this with my team lead and will get back to you -- likely sometime next week.
Thanks once again for the helpful information.
Sam
I'll be discussing this with my team lead and will get back to you -- likely sometime next week.
Thanks once again for the helpful information.
Sam
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!