Appearance
Pagination
List endpoints return paginated results. The default page size is 25 items, configurable up to 100.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
per_page | integer | 25 | Items per page (max 100; larger values are capped at 100) |
GET /v2/resources/blog-posts?page=2&per_page=10Response structure
Every paginated response includes meta and links objects alongside the data array:
json
{
"data": [ ... ],
"meta": {
"current_page": 2,
"per_page": 10,
"total": 42,
"last_page": 5,
"from": 11,
"to": 20
},
"links": {
"first": "https://api.diggama.com/v2/resources/blog-posts?per_page=10&page=1",
"last": "https://api.diggama.com/v2/resources/blog-posts?per_page=10&page=5",
"prev": "https://api.diggama.com/v2/resources/blog-posts?per_page=10&page=1",
"next": "https://api.diggama.com/v2/resources/blog-posts?per_page=10&page=3"
}
}links
| Key | Description |
|---|---|
first | URL to the first page |
last | URL to the last page |
prev | URL to the previous page (null on the first page) |
next | URL to the next page (null on the last page) |
Links keep the rest of your query string (per_page, filter, sort, search, variant…), so you can follow them as-is.
meta
| Key | Type | Description |
|---|---|---|
current_page | integer | The current page number |
last_page | integer | The last available page |
per_page | integer | Items per page |
total | integer | Total number of matching resources |
from | integer | null | Position of the first item on this page (null when the page is empty) |
to | integer | null | Position of the last item on this page (null when the page is empty) |
Iterating through all pages
Use meta.last_page or follow links.next until it is null:
javascript
async function fetchAll(blueprint, token) {
let page = 1;
let results = [];
while (true) {
const res = await fetch(
`https://api.diggama.com/v2/resources/${blueprint}?page=${page}&per_page=100`,
{ headers: { 'Authorization': `Bearer ${token}` } }
);
const json = await res.json();
results.push(...json.data);
if (page >= json.meta.last_page) break;
page++;
}
return results;
}If you need all resources in a single request without pagination, use the Export endpoint instead.