Incremental sync with updatedSince
Read only what changed since your last run, with a sync loop.
/events, /showtimes, /locations, /event-series, /festivals, /artists, /works and /genres take updatedSince (an instant with Z or an offset). The list then contains only records whose updatedAt is at or after that instant. Regions have no change time; re-read them now and then (their answers may be kept for a day, Caching with ETag).
- On events and showtimes,
updatedAtis the latest change of the showtime, its event series or its venue. If any of the three changed, all days of that showtime are listed again. - On venues, event series, festivals, artists, works and genres, it is the change time of the record itself.
- Edits your organisation makes in the console (your own texts and images) are not included in
updatedAt. Changes to linked records other than those named (for example an artist or a festival linked to an event) do not move it either.
A sync loop:
- Remember the time
Tat which you start a sync run, minus a safety margin of a few minutes. - Read
GET /events?updatedSince=<last T>&paginate=cursor&limit=100(with your usual filters) untilhasMoreisfalse. Store each row byid. - Read
GET /changes?since=<last T>&types=eventsuntilhasMoreisfalseand apply it (see Removals: the changes feed). - Save
Tfor the next run.
Use id as the key of an event row (Stable ids and merged records). Combine with If-None-Match on detail requests you repeat.