Box.com API delta download

205 views Asked by At

Can anyone advise the best way to synchronize files via Box API?

My app needs to download deep structure of folders for offline use and currently needs to recursively scan each folder for changes. Is there any way to identify whether anything changed in the tree branch within a single call? Modification time stamp, etag and size on top folder level do not change in many cases (e.g. when moving files from one sub-folder to another sub-folder).

Tracking of events seems to be an alternative (though quite complex), but I'm afraid it may not work in my case due to purging of event stream (my users may synchronize once per few months).

1

There are 1 answers

0
Peter On

The /events endpoint has a per-user long-poll event stream that tells you every file, folder, share, and collab that has changed for the user.

It is what Box uses to power it's own Sync client, and it is publicly available. Yes, it can get quite complex if you want perfect behavior.

The event stream so far has not been purged, to my knowledge. So syncing once every few months is still achievable. Beware that you're talking about potentially syncing a LOT of files. You may run out of local storage....