Pagination
Lists return { data, next_cursor }. Pass the cursor back to get the next page.
Every list endpoint takes two query parameters:
| Parameter | Meaning |
|---|---|
limit | Page size, 1 to 100. Defaults to 50. |
cursor | The next_cursor from the previous page. Omit it for the first page. |
And returns:
{
"data": [{ "id": "evt_...", "...": "..." }],
"next_cursor": "eyJ0IjoiMjAyNy0wMS0wOFQyMzozMDowMFoiLCJpIjoiZXZ0XyJ9"
}next_cursor is null on the last page. Treat it as an opaque string: pass it back exactly as you got it, and keep any filters (such as status) the same between pages.
Every page, in a loop
curl "https://api.whocoming.com/v1/events/evt_demo0000000000000001/rsvps?limit=100&status=going" \
-H "Authorization: Bearer wc_test_..."
curl "https://api.whocoming.com/v1/events/evt_demo0000000000000001/rsvps?limit=100&status=going&cursor=eyJ0Ijoi..." \
-H "Authorization: Bearer wc_test_..."async function allRsvps(eventId: string) {
const rsvps = [];
let cursor: string | null = null;
do {
const url = new URL(`https://api.whocoming.com/v1/events/${eventId}/rsvps`);
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.WHOCOMING_API_KEY}` },
});
const page = await res.json();
rsvps.push(...page.data);
cursor = page.next_cursor;
} while (cursor);
return rsvps;
}The SDK does this for you: for await (const rsvp of wc.rsvps.list(eventId)).
Order
| List | Order |
|---|---|
GET /v1/events | Soonest first |
GET /v1/series | Newest first |
GET /v1/events/{id}/rsvps | Oldest first |
GET /v1/webhook-deliveries | Newest first |
GET /v1/public/orgs/{slug}/events | Soonest first, upcoming only |