Pagination
The ThousandEyes API returns data in a paginated format whenever the response exceeds a single page of data. For requests returning current values or data less than a page, all data is presented within a single page.
To navigate through multiple pages of result data, inspect the _links
element in your response. The _links[next]
element provides the URL to the next page of data.
Here's an example of a response including pagination:
Request
$ curl -i https://api.thousandeyes.com/v7/alerts -H "Authorization: Bearer $BEARER_TOKEN"
Response
In this request, note the following:
- The requested window was 10d, which triggered pagination. The duration necessary to initiate pagination varies based on factors such as the number of agents on a test and the number of records returned per agent. For example, DNS Server tests typically yield more verbose results than page load tests due to querying multiple nameservers per agent.
- If the result set exceeds one page, a
next
URL will be provided in the_links
section of the data.
{
"alerts": [...],
"_links": {
"self": {
"href": "https://api.thousandeyes.com/v7/alerts"
},
"next": {
"href": "https://api.thousandeyes.com/v7/alerts?cursor=WzAsMTcwODAxMTAwMDAwMCwiNGU1NzAzYTEtMjVhYy00NmFiLTgwYzAtZmQ5NzE3NGJiYjMwIl0%3D"
}
}
}