Sync Events and Tasks to Another System

Run a sync on a schedule, for example every 15 minutes. The first run reads all events and tasks a page at a time. Later runs read changes and update a local mirror by record id. Each language below shows the full workflow.

1. Read every page

Use $limit and $offset on /v1/events and /v1/tasks. Add records_found to the offset until has_more is false. total_records is the total matching count, not the number in this page. In a URL, encode $ as %24 or let your language's query-string helper encode it.

2. Save a mirror and a cursor for each record type

Upsert each event or task into your mirror by id. Keep separate cursors for event_last_update_timestamp and task_last_update_timestamp, using each timestamp exactly as returned in UTC, including its Z. Save a new cursor only after every page has been read and the mirror has been saved successfully.

3. Read changes inclusively

Send the saved cursor as filter_by_last_update_timestamp_greater_than_or_equal_to. Records at that boundary return again: upsert their current payload again rather than skipping an id just because its timestamp matches. Two changes can share a timestamp. An inclusive reread preserves the later data without duplicating mirror records.
Set EXHIBITDAY_API_KEY. Optionally set EXHIBITDAY_SYNC_DIR for the mirror and cursor files; the default is the current directory.
Code Samples
#!/usr/bin/env bash
# Requires bash, curl and Python 3. Set EXHIBITDAY_API_KEY.
python3 - <<'EXHIBITDAY_PY'
# Python 3; standard library only. Set EXHIBITDAY_API_KEY before running.
import csv
import datetime
import json
import os
import re
import time
import urllib.error
import urllib.parse
import urllib.request
import uuid
from pathlib import Path

BASE = "https://api.exhibitday.com/v1"
SPEC = json.loads("{\"preserveNumbers\":false,\"requests\":{\"events\":{\"method\":\"GET\",\"path\":\"/events\"},\"tasks\":{\"method\":\"GET\",\"path\":\"/tasks\"}}}")
API_KEY = os.environ["EXHIBITDAY_API_KEY"]
if not API_KEY.strip():
    raise RuntimeError("Set EXHIBITDAY_API_KEY")

def decode_json(text):
    if SPEC["preserveNumbers"]:
        # Quote JSON NUMBER tokens, never text inside a JSON string, to keep CSV decimals exact.
        text = re.sub(r'"(?:\\.|[^"\\])*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?',
                      lambda m: m[0] if m[0].startswith('"') else json.dumps(m[0]), text)
    return json.loads(text)

# This terminal version uses curl for HTTP and Python's standard library for JSON/CSV.
import subprocess
import tempfile

def transport(method, url, headers, data):
    with tempfile.TemporaryDirectory(prefix="exhibitday-guide-") as directory:
        folder = Path(directory)
        command = ["curl", "--silent", "--show-error", "--request", method, "--url", url,
                   "--max-time", "30", "--dump-header", str(folder / "headers"),
                   "--output", str(folder / "body"), "--write-out", "%{http_code}"]
        for name, value in headers.items():
            command += ["--header", name + ": " + value]
        if data is not None:
            (folder / "request").write_bytes(data)
            command += ["--data-binary", "@" + str(folder / "request")]
        result = subprocess.run(command, capture_output=True, text=True)
        if result.returncode:
            raise urllib.error.URLError(result.stderr.strip())
        response_headers = {}
        blocks = (folder / "headers").read_text(encoding="iso-8859-1").replace("\r\n", "\n").strip().split("\n\n")
        for line in blocks[-1].splitlines()[1:]:
            name, separator, value = line.partition(":")
            if separator:
                response_headers[name] = value.strip()
        return int(result.stdout), (folder / "body").read_bytes(), response_headers


class ApiError(RuntimeError):
    """An API error response. Branch on error_code (and status), never on the message text.
    uncertain is True when a PATCH or DELETE got no response or a server error: it may or may not have been applied."""
    def __init__(self, status, body, uncertain=False):
        self.status = status
        self.uncertain = uncertain
        self.error_code = body.get("error_code") if isinstance(body, dict) else None
        super().__init__(f"{body.get('error_code')} {body.get('error_params')}: {body.get('errors')} (request {body.get('request_id')})"
                         if isinstance(body, dict) else "HTTP " + str(status) if status else "No response")

def call(name, params=None, body=None, extra_headers=None, key=None):
    route = SPEC["requests"][name]
    headers = {"api_key": API_KEY, "Accept": "application/json", **(extra_headers or {})}
    if route["method"] == "POST":
        headers["Idempotency-Key"] = key or str(uuid.uuid4())  # generated ONCE, before retries
    data = None if body is None else json.dumps(body).encode("utf-8")
    if data is not None:
        headers["Content-Type"] = "application/json"
    query = urllib.parse.urlencode(params or {})
    url = BASE + route["path"] + ("?" + query if query else "")
    # A GET, or a POST with its Idempotency-Key, can be sent again. A PATCH or DELETE that got no response or a
    # server error is never resent blindly: it may already have been applied, so the caller reads the record first.
    resend = route["method"] in ("GET", "POST")
    for attempt in range(5):
        try:
            status, raw, response_headers = transport(route["method"], url, headers, data)
        except (urllib.error.URLError, TimeoutError):
            if not resend:
                raise ApiError(0, None, uncertain=True)
            if attempt == 4:
                raise
            time.sleep(2 ** attempt)
            continue
        response_headers = {k.lower(): v for k, v in response_headers.items()}
        result = None
        if status != 304 and raw:
            try:
                result = decode_json(raw.decode("utf-8"))
            except (ValueError, UnicodeError):
                if status < 400:
                    raise RuntimeError("Expected a JSON success response")
        if status >= 500 and not resend:
            raise ApiError(status, result, uncertain=True)
        retry = status == 429 or status >= 500 or (status == 409 and isinstance(result, dict) and result.get("error_code") == "idempotency_key_in_use")
        if retry:
            if attempt == 4:
                raise RuntimeError("Retry limit reached; check the request outcome before starting a new create")
            delay = response_headers.get("retry-after", str(2 ** attempt))
            time.sleep(max(0, float(delay)))
            continue
        if status >= 400:
            raise ApiError(status, result)
        return {"status": status, "body": result, "headers": response_headers}
    raise RuntimeError("Retry limit reached")

def pages(name, params=None):
    offset = 0
    while True:
        page = call(name, {**(params or {}), "$limit": 100, "$offset": offset})["body"]
        yield from page["list_data"]
        if not page["has_more"]:
            break
        count = int(page["records_found"])
        if count <= 0:
            raise RuntimeError("Server returned an empty page with has_more=true")
        offset += count

def load_json(path, fallback):
    return json.loads(path.read_text(encoding="utf-8")) if path.exists() else fallback

def save_json(path, value):
    temp = path.with_name(path.name + ".tmp")
    temp.write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
    temp.replace(path)

directory = Path(os.environ.get("EXHIBITDAY_SYNC_DIR", "."))
directory.mkdir(parents=True, exist_ok=True)
state_path = directory / "exhibitday-sync-state.json"
state = load_json(state_path, {})
for entity, timestamp in [("events", "event_last_update_timestamp"), ("tasks", "task_last_update_timestamp")]:
    since = state.get(entity)
    params = {"filter_by_last_update_timestamp_greater_than_or_equal_to": since} if since else {}
    mirror_path = directory / ("exhibitday-" + entity + ".json")
    mirror = load_json(mirror_path, {})
    latest, processed = since, 0
    for record in pages(entity, params):
        # Always upsert inclusive-boundary rows: the same id/time can contain a later edit.
        mirror[str(record["id"])] = record
        stamp = record[timestamp]
        if latest is None or stamp > latest:
            latest = stamp
        processed += 1
    save_json(mirror_path, mirror)  # persist data BEFORE moving this entity's checkpoint
    if latest:
        state[entity] = latest
    save_json(state_path, state)
    print(entity, processed, "rows processed; cursor", latest)
# Incremental lists do not report deletions. Reconcile full current IDs separately.


EXHIBITDAY_PY

Example HTTP response body (JSON)

GET /v1/events - HTTP 200
{
  "records_found": 1,
  "total_records": 1,
  "has_more": false,
  "list_type": "event",
  "list_data": [
    {
      "id": 12345,
      "exhibitday_url": "https://www.exhibitday.com/Workspace/Event/98765?eid=12345",
      "name": "Sample Event",
      "start_date": "2026-12-14",
      "end_date": "2026-12-16",
      "participation_type_id": 1,
      "participation_type": "Committed",
      "format_id": 1,
      "format": "In-Person",
      "star_rating": 0,
      "tags": [],
      "website_url": "",
      "venue_name": "",
      "venue_address": "",
      "venue_location_display_name": "",
      "venue_address_latitude": "",
      "venue_address_longitude": "",
      "booth_size": "",
      "booth_number": "",
      "booth_reservation_status_id": 1,
      "booth_reservation_status": "Need to Reserve",
      "booth_reserve_by_date": "",
      "booth_date_reserved": "",
      "budget_booth_reservation": 0.00,
      "budget_booth_services": 0.00,
      "budget_attendee_registrations": 0.00,
      "budget_travel": 0.00,
      "budget_giveaways": 0.00,
      "budget_shipments": 0.00,
      "budget_event_activities": 0.00,
      "budget_misc_expenses": 0.00,
      "budget_sponsorships": 0.00,
      "total_sum_event_budgets": 0.00,
      "cost_booth_reservation": 0.00,
      "cost_booth_services": 0.00,
      "cost_attendee_registrations": 0.00,
      "cost_travel_reservations": 0.00,
      "cost_giveaways": 0.00,
      "cost_shipments": 0.00,
      "cost_event_activities": 0.00,
      "cost_misc_expenses": 0.00,
      "cost_sponsorships": 0.00,
      "total_sum_event_costs": 0.00,
      "event_notes": "",
      "booth_notes": "",
      "budget_notes": "",
      "roi_notes": "",
      "roi_num_leads": 0,
      "roi_num_impressions_booth": 0,
      "roi_num_impressions_sponsorships": 0,
      "roi_num_impressions_media": 0,
      "roi_num_meetings_existing_customers": 0,
      "roi_num_meetings_new_customers": 0,
      "roi_amount_actual_sales": 0.00,
      "roi_amount_potential_sales": 0.00,
      "event_created_timestamp": "2026-11-14T17:00:00Z",
      "event_last_update_timestamp": "2026-11-14T17:00:00Z",
      "event_created_by": {
        "id": "11111111-2222-4333-8444-555555555555",
        "first_name": "Jane",
        "last_name": "Smith",
        "email": "jane@example.invalid"
      },
      "custom_fields": null,
      "task_sections": null,
      "tasks": null,
      "misc_expenses_credits": null,
      "integration_metadata_field_1": "",
      "integration_metadata_field_2": "",
      "integration_metadata_field_3": "",
      "integration_metadata_field_4": "",
      "integration_metadata_field_5": ""
    }
  ]
}
Note: Illustrative response. The first events page on an initial sync, before a saved timestamp exists. This is the server's JSON page, not the local mirror files or console output. The illustrative workspace has one event; later task pages are a separate request. Request inputs: {"$limit":100,"$offset":0}.
Requirements: the curl workflow uses Bash, curl and Python 3; JavaScript uses Node.js 18 or later (save it as .cjs); Python uses its standard library; C# uses a .NET 8 console project (Program.cs). Java needs Java 11 or later, saved as Main.java, with Gson 2.14.0 on both the compile and runtime classpaths. PHP needs PHP 8.1 or later with cURL; Ruby 3.1 or later and Go 1.18 or later use their standard libraries.
The same paging and cursor pattern applies to /v1/tasks/comments with comment_last_update_timestamp, and /v1/events/miscexpensecredits with event_misc_expense_credit_last_update_timestamp.

4. Keep your other system's id

integration_metadata_field_1 through integration_metadata_field_5 are available only through the API. For example, use PATCH /v1/events to store your CRM id in integration_metadata_field_1, then find it with filter_by_integration_metadata_field_1. These optional identifiers are separate from the sync cursor.

5. Reconcile deletions separately

A deleted record does not appear in a changed-since list; there is no tombstone feed. Periodically read a complete current id list and compare it with your mirror. $return_event_lites=true makes an event id refresh lighter. Treat an absent record as deleted only after that full reconciliation succeeds, never because it was absent from an incremental response.