Skip to main content

Overview

All list endpoints in the DialNexa API return paginated results. By default, each page contains up to 20 records. You can request up to 100 records per page using the limit parameter.

Request parameters

ParameterTypeDefaultDescription
pageinteger1The page number to retrieve. Starts at 1.
limitinteger20Number of records per page. Maximum is 100.

Example request

curl "https://api.dialnexa.com/v1/call-logs?page=2&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response shape

Every paginated response wraps the results in a data array and includes a meta object with pagination details:
{
  "data": [
    { "id": "log_abc123", "status": "completed", ... },
    { "id": "log_def456", "status": "completed", ... }
  ],
  "meta": {
    "page": 2,
    "limit": 50,
    "total": 320,
    "totalPages": 7
  }
}

Meta fields

FieldTypeDescription
pageintegerThe current page number.
limitintegerThe number of records requested per page.
totalintegerTotal number of records matching the query across all pages.
totalPagesintegerTotal number of pages. Calculated as ceil(total / limit).

Iterating through all pages

To fetch all records, iterate until page > totalPages:
async function fetchAllCallLogs(apiKey: string) {
  const logs = [];
  let page = 1;

  while (true) {
    const response = await fetch(
      `https://api.dialnexa.com/v1/call-logs?page=${page}&limit=100`,
      { headers: { Authorization: `Bearer ${apiKey}` } }
    );
    const { data, meta } = await response.json();

    logs.push(...data);

    if (page >= meta.totalPages) break;
    page++;
  }

  return logs;
}
import requests

def fetch_all_call_logs(api_key: str) -> list:
    logs = []
    page = 1

    while True:
        response = requests.get(
            "https://api.dialnexa.com/v1/call-logs",
            headers={"Authorization": f"Bearer {api_key}"},
            params={"page": page, "limit": 100}
        )
        payload = response.json()
        logs.extend(payload["data"])

        if page >= payload["meta"]["totalPages"]:
            break
        page += 1

    return logs

ETag caching

The GET /call-logs endpoint supports HTTP conditional requests using ETags. On the first request, the server returns an ETag header:
ETag: "abc123def456"
On subsequent requests, pass the ETag in the If-None-Match header:
curl "https://api.dialnexa.com/v1/call-logs" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "If-None-Match: \"abc123def456\""
If the data has not changed, the server returns 304 Not Modified with no body, saving bandwidth. If the data has changed, the server returns 200 OK with the updated data and a new ETag.