LogoLogo
HomepageSign Up
Version 2.0.0
  • Product Docs
  • API Docs
  • Changelog
Version 2.0.0
  • Overview
  • Screendesk API
    • Overview
    • Authentication
    • Errors
    • Pagination
    • API Reference
      • Recordings
      • Users
  • SCIM / Autoprovisioning
    • Overview
    • Authentication
    • API Reference
Powered by GitBook
On this page
  • Pagination Fields
  • Usage Example

Was this helpful?

Export as PDF
  1. Screendesk API

Pagination

Some methods return paginated results. The formatting of a paginated result is always:

{
  "pagination": {
    "next_page": "...",
    "prev_page": "...",
    "last_page": "...",
    "page": "...",
    "items": "...",
    "pages": "...",
    "from": "...",
    "to": "...",
    "count": "..."
  },
  "records": [
    ...
  ]
}

The pagination object contains metadata about the current page and links to other pages. The records array contains the actual data for the current page.

Pagination Fields

  • next_page: The number of the next page (if available)

  • prev_page: The number of the previous page (if available)

  • last_page: The number of the last page

  • page: The current page number

  • items: The number of items per page

  • pages: The total number of pages

  • from: The starting index of the current page's items

  • to: The ending index of the current page's items

  • count: The total number of items across all pages

Fields that are not applicable (e.g., prev_page on the first page) will be omitted from the response.

Usage Example

Let's say you make a GET request to a paginated endpoint:

GET /api/v2/users

You might receive a response like this:

{
  "pagination": {
    "next_page": 2,
    "last_page": 5,
    "page": 1,
    "items": 100,
    "pages": 5,
    "from": 1,
    "to": 100,
    "count": 450
  },
  "users": [
    ...
  ]
}

To get the next page of results, you would make a request to:

GET /api/v2/users?page=2
PreviousErrorsNextAPI Reference

Last updated 7 months ago

Was this helpful?