About 15 minutes
SYNC PLANS TO A WAREHOUSE.
Pull every media plan and omni-channel campaign on a schedule, page through them with cursors, and load them into your own store.
Steps
1. Get a key
Workspace admins issue keys in the app at /app/api-keys. Start with a sandbox key: it is bound to a showroom workspace and can never touch live data. Keep the secret server-side.
export QN_API_KEY="qn_sandbox_…" curl "$QN_BASE/me" -H "Authorization: Bearer $QN_API_KEY"2. Page with cursors
Lists return meta.next_cursor. Send it back as ?cursor= until it comes back null. Cursors are stable while rows are being written; offset is deprecated and answers with a Sunset header.
import { QubitNotion } from "@qubitnotion/sdk"; const qn = new QubitNotion({ apiKey: process.env.QN_API_KEY! }); for await (const plan of qn.paginate("/plans", { limit: 100 })) { await warehouse.upsertPlan(plan); }3. Narrow the pull
There is no changed-since filter on v1 yet, so a sync is a full pass. Keep it cheap by filtering plans on status and by diffing against your own copy on load.
curl "$QN_BASE/plans?status=active&limit=100" \ -H "Authorization: Bearer $QN_API_KEY"4. Handle limits
Read RateLimit-Remaining on each response and pause when it approaches zero. A 429 carries Retry-After; the SDKs wait for you.
Done when
A full pass that ends with meta.next_cursor equal to null and the same row count in your warehouse.