Skip to main content

Pagination Parameters

You can control pagination using the following query parameters:
page_number
integer
The page of results you want to retrieve (starting from 1)

Example Usage

Here’s how to retrieve paginated results using cURL:
curl --request GET \
  --url "https://{your-subdomain}.neetodesk.com/api/v1/public/tickets?page_number=2" \
  --header 'X-Api-Key: your-api-key'
const response = await fetch(
  "https://{your-subdomain}.neetodesk.com/api/v1/public/tickets?page_number=2",
  {
    method: "GET",
    headers: {
      "X-Api-Key": "your-api-key",
      "Content-Type": "application/json",
    },
  }
);

const data = await response.json();
console.log(data);
import requests

url = "https://{your-subdomain}.neetodesk.com/api/v1/public/tickets"
params = {
    "page_number": 2
}
headers = {
    "X-Api-Key": "your-api-key",
    "Content-Type": "application/json"
}

response = requests.get(url, params=params, headers=headers)
data = response.json()
print(data)
This retrieves the second page of tickets.

Response Structure

Paginated responses include metadata about the pagination in JSON format:
Response Example
{
  "tickets": [
    // ... array of ticket objects
  ],
  "pagination": {
    "total_records": 150,
    "current_page_number": 2,
    "total_pages": 6,
    "page_size": 30
  }
}
pagination.total_records
integer
The total number of items across all pages
pagination.current_page_number
integer
The current page number (if pagination was used)
pagination.total_pages
integer
The total number of pages available (if pagination was used)
pagination.page_size
integer
The number of items per page in the response

Default Behavior

If the page_number parameter is not provided, default values will be applied:
  • page_number: 1 (first page)
  • page_size: 30 (30 items per page)

Best Practices

  1. Start with reasonable page sizes: Expect ~30 items per page by default.
  2. Handle empty results: Always check if the returned array is empty to detect the end of data.
  3. Use pagination metadata: Use the pagination.total_records field to calculate the total number of pages needed.
  4. Implement error handling: Handle cases where the requested page doesn’t exist.