Pagination

Paginating through resources

Most key resources in HeyTeam API support for bulk fetches and return the result data in lists (in the 'data' key of the response).

📘

Pagination Method

HeyTeam uses offset-based pagination approach to return large collection data. HeyTeam will soon start using cursor-based pagination approach to return large collection data in a more resource efficient manner.

The actual Offset based pagination method returns three things :

  1. A portion of the collection you are querying for (in the data key)
  2. The links to switch between pages (in the links key)
  3. The meta information of the page (in the meta key)

Example of a paginated responses :

`
{
    "data": [
        {
            ...
        },
				...
    ],
    "links": {
        "first": "https://[your-domain].heyteam.com/eapi/requirements?page=1",
        "last": "https://[your-domain].heyteam.com/eapi/requirements?page=18",
        "prev": "https://[your-domain].heyteam.com/eapi/requirements?page=1",
        "next": "https://[your-domain].heyteam.com/eapi/requirements?page=3"
    },
    "meta": {
        "current_page": 2,
        "from": 21,
        "last_page": 18,
        "path": "https://[your-domain].heyteam.com/eapi/requirements",
        "per_page": 20,
        "to": 40,
        "total": 356
    }
}