Developers · Core concepts

Pagination

Cursor pagination on every list endpoint: limit, cursor, has_more and next_cursor, with complete loops in seven languages.

Version
v1.0.0
Base URL
https://dppapi-production.up.railway.app/v1
Format
JSON · OpenAPI 3.1
FeedbackLast updated

Dieser Artikel liegt noch nicht auf Deutsch vor und wird unten auf Englisch angezeigt.

On this pageParameters and envelope

List endpoints return one page at a time with an opaque cursor to the next. Cursors stay correct while records are being added, which offsets cannot promise.

Parameters and envelope

ParameterMeaning
limitPage size, 1–200. Default 50.
cursorThe next_cursor from the previous page. Omit for the first page.
Every list response
{"data": [ { "id": "…" } ],"has_more": true,"next_cursor": "eyJpZCI6ImNtMXE4eTBicTAwMDZsNzBmeDl5OHo3dzYifQ"}
  • Stop when has_more is false; next_cursor is then null.
  • Treat the cursor as opaque: do not build, decode or modify it.
  • Keep the same filters on every page of one walk; change filters, start again without a cursor.
  • Lists are newest first, and the cursor marks the position of the last row. Records created during a walk land before your starting point, so a walk never skips or repeats a row — pick them up on the next incremental run.

Paginated endpoints

EndpointFilters
`GET /models`category, updated_since, complete
`GET /passports`model_id, serial, unique_identifier, status, published, updated_since, created_since
`GET /passports/{id}/events`since, event_type
`GET /documents`model_id, type
`GET /audit`entity, entity_id, since
`GET /webhooks/{id}/deliveries`status

GET /models/{id}/items predates cursors and pages by number (page, pageSize); for syncing batteries use GET /passports?model_id= instead.

The first page

curl "https://dppapi-production.up.railway.app/v1/passports?model_id=cm1q8x2k40003l70f9a8s7d6e&limit=200" \-H "Authorization: Bearer $DPP_API_KEY"

Complete loops

Each of these walks every page and stops on its own:

// Node.js 18+. An async iterator over every passport, page by page.const BASE = 'https://dppapi-production.up.railway.app/v1';async function* passports(filters = {}) {let cursor;do {const qs = new URLSearchParams({ ...filters, limit: '200', ...(cursor && { cursor }) });const res = await fetch(`${BASE}/passports?${qs}`, {headers: { Authorization: `Bearer ${process.env.DPP_API_KEY}` },});if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);const page = await res.json();yield* page.data;cursor = page.has_more ? page.next_cursor : undefined;} while (cursor);}for await (const passport of passports({ model_id: 'cm1q8x2k40003l70f9a8s7d6e' })) {console.log(passport.id, passport.status);}

To keep a copy up to date after the first walk, see incremental sync.

Cookie-Einstellungen

Sie entscheiden, welche Cookies verwendet werden. Ihre Wahl können Sie jederzeit über „Cookie-Einstellungen“ im Footer ändern. Datenschutzerklärung

Notwendig

Immer aktiv

Für den Betrieb der Website erforderlich: Ihr Hell-/Dunkel-Design und diese Cookie-Auswahl werden in Ihrem Browser gespeichert. Sie dienen nicht dem Tracking.

Analyse

Google Analytics 4 misst über Statistiken, wie Seiten genutzt werden, und hilft uns, die Website zu verbessern. Wenn Sie zustimmen, setzt es Cookies und erfasst Ihren Besuch vollständig. Wenn Sie ablehnen, setzt es keine Cookies, doch Google kann weiterhin technische Daten erhalten, etwa die aufgerufene Seite, Ihren Browsertyp und Ihre IP-Adresse.

_ga, _ga_* · bis zu 2 Jahre · Google