Skip to content

Pagination ​

List endpoints return paginated results. The default page size is 25 items, configurable up to 100.

Query parameters ​

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger25Items per page (max 100; larger values are capped at 100)
GET /v2/resources/blog-posts?page=2&per_page=10

Response 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"
  }
}
KeyDescription
firstURL to the first page
lastURL to the last page
prevURL to the previous page (null on the first page)
nextURL 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 ​

KeyTypeDescription
current_pageintegerThe current page number
last_pageintegerThe last available page
per_pageintegerItems per page
totalintegerTotal number of matching resources
frominteger | nullPosition of the first item on this page (null when the page is empty)
tointeger | nullPosition 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.

Diggama Documentation