<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Java example to find recent updates (without having to poll)  using webhook notification in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/200830#M9456</link>
    <description>&lt;P&gt;Do you have an example in Java that selects recent adds/deletes to a dropbox folder do doesn't require polling?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The examples that I pulled from Github do contain one that uses a loop that continuously polls to find recent updates. I have written a solution using webhooks. I would prefer not to have to poll whether in a separate thread or not. I have used the &amp;nbsp;ListFolderGetLatestCursorBuilder and ListFolderGetLatestCursorResult, followed by issuing a DbxClientV2.files.listFolderContinue() without success. &amp;nbsp;I find that&amp;nbsp;&lt;SPAN&gt;ListFolderGetLatestCursorResult initially returns all entries regardless of whether they are recently changed or not.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The only way I see to pick out the recent updates is to use the FileMetaData.getClientModified to get the timestamp of when the file was added. I see that the API warns against using it for this purpose, but I see no other recourse at this time, without having to poll.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:27:01 GMT</pubDate>
    <dc:creator>sl4677</dc:creator>
    <dc:date>2019-05-29T09:27:01Z</dc:date>
    <item>
      <title>Java example to find recent updates (without having to poll)  using webhook notification</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/200830#M9456</link>
      <description>&lt;P&gt;Do you have an example in Java that selects recent adds/deletes to a dropbox folder do doesn't require polling?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The examples that I pulled from Github do contain one that uses a loop that continuously polls to find recent updates. I have written a solution using webhooks. I would prefer not to have to poll whether in a separate thread or not. I have used the &amp;nbsp;ListFolderGetLatestCursorBuilder and ListFolderGetLatestCursorResult, followed by issuing a DbxClientV2.files.listFolderContinue() without success. &amp;nbsp;I find that&amp;nbsp;&lt;SPAN&gt;ListFolderGetLatestCursorResult initially returns all entries regardless of whether they are recently changed or not.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The only way I see to pick out the recent updates is to use the FileMetaData.getClientModified to get the timestamp of when the file was added. I see that the API warns against using it for this purpose, but I see no other recourse at this time, without having to poll.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:27:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/200830#M9456</guid>
      <dc:creator>sl4677</dc:creator>
      <dc:date>2019-05-29T09:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Java example to find recent updates (without having to poll)  using webhook notification</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/200845#M9458</link>
      <description>&lt;P&gt;I 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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The basic idea is that you can call listFolder and listFolderContinue initially until hasMore is false to get the initial state. Then, you can&amp;nbsp;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There's more information on processing these in the documentation here:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#listFolder-java.lang.String-" target="_blank"&gt;https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#listFolder-java.lang.String-&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/reference/webhooks" target="_blank"&gt;https://www.dropbox.com/developers/reference/webhooks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 18:30:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/200845#M9458</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-06T18:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Java example to find recent updates (without having to poll)  using webhook notification</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/200855#M9459</link>
      <description>Thanks for your prompt response Greg.&lt;BR /&gt;I'll be discussing this with my team lead and will get back to you -- likely sometime next week.&lt;BR /&gt;Thanks once again for the helpful information.&lt;BR /&gt;Sam</description>
      <pubDate>Fri, 06 Jan 2017 19:19:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/200855#M9459</guid>
      <dc:creator>sl4677</dc:creator>
      <dc:date>2017-01-06T19:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Java example to find recent updates (without having to poll)  using webhook notification</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/202032#M9576</link>
      <description>&lt;P&gt;Hi Greg --&amp;nbsp;&lt;/P&gt;&lt;P&gt;TheAPI &amp;nbsp;documentation you mentioned at &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#listFolder-java.lang.String-" target="_blank"&gt;https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.1.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#listFolder-java.lang.String-&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;suggests using &lt;SPAN&gt;&lt;STRONG&gt;ListFolderArg&lt;/STRONG&gt;.getRecursive() to keep a local cache of the Dropbox metadata state (e.g. the latest cursor for a user) to be able to find the latest file changes when a user send a Webhook notification. It appears that ListFolderArg was available in version 2.0, but is no longer documented or used in v2.1 .&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Using version 2.1, what do you then recommend that I use to store the state locally, to be able to find recent file updates for a user with a Webhook notification?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Sam&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 23:46:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/202032#M9576</guid>
      <dc:creator>sl4677</dc:creator>
      <dc:date>2017-01-13T23:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Java example to find recent updates (without having to poll)  using webhook notification</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/202040#M9579</link>
      <description>&lt;P&gt;Thanks for pointing that out! It looks like the documentation needs to be updated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the builder to build this call with the desired options, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ListFolderResult result = client.files().listFolderBuilder("").withRecursive(true).start();&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Jan 2017 00:32:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-example-to-find-recent-updates-without-having-to-poll-using/m-p/202040#M9579</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-14T00:32:45Z</dc:date>
    </item>
  </channel>
</rss>

