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

Este artículo aún no está disponible en español; se muestra a continuación en inglés.

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.

Preferencias de cookies

Tú decides qué cookies se usan. Puedes cambiar tu elección en cualquier momento desde «Configuración de cookies» en el pie de página. Política de privacidad

Necesarias

Siempre activas

Imprescindibles para que el sitio funcione: tu tema claro/oscuro y esta elección de cookies se guardan en tu navegador. No sirven para rastrearte.

Analítica

Google Analytics 4 mide cómo se usan las páginas mediante estadísticas, lo que nos ayuda a mejorar el sitio. Si aceptas, instala cookies y mide tu visita por completo. Si rechazas, no instala cookies, pero Google aún puede recibir datos técnicos como la página vista, el tipo de navegador y la dirección IP.

_ga, _ga_* · hasta 2 años · Google