Pagination
List endpoints (GET /clients, GET /transits, GET /events/{id}/passes…) are paginated.
| Parameter | Default | Constraints |
|---|---|---|
page | 1 | integer ≥ 1 |
limit | 10 | integer from 1 to 1,000 |
- curl
- SDK Node.js
- nodejs
- php
- python
- java
- csharp
- go
- ruby
- CURL
curl -L 'https://api-v2.test.eldowallet.fr/clients?page=2&limit=100' \
-H 'Accept: application/json' \
-H 'x-lang: en' \
-H 'Authorization: Bearer <token>'
{
"docs": [{"_id": "…", "firstName": "Camille", "lastName": "Martin"}],
"totalDocs": 1342,
"limit": 100,
"page": 2,
"totalPages": 14,
"pagingCounter": 101,
"hasPrevPage": true,
"hasNextPage": true,
"prevPage": 1,
"nextPage": 3
}
Iterate over a whole list
Iterate over all pages
async function* allClients(token) {
let page = 1;
while (page) {
const res = await fetch(`https://api-v2.test.eldowallet.fr/clients?page=${page}&limit=500`, {
headers: {Authorization: `Bearer ${token}`},
});
const body = await res.json();
yield* body.docs;
page = body.nextPage; // null on the last page
}
}
For a full export
To export all your customers, use the background CSV export instead: POST/csv-operations/export-csv.