Response-time samples for a whole page of monitors, keyed by monitor id.
const url = 'https://api.siteqwality.com/monitors/recent-checks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"monitor_ids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siteqwality.com/monitors/recent-checks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "monitor_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'The dashboard drew one sparkline per row and fetched each one with its own
GET /http/job/{id}/recent. A fifty-row page was fifty requests, roughly
half of them heartbeat and browser-check ids sent to an HTTP-job endpoint
that could only ever answer with an empty array, each one having taken a
reader connection to say so. At five hundred monitors that is a
self-inflicted outage.
Ids that are not HTTP monitors, or that belong to another account, are absent from the response rather than present-and-empty. The caller reads the map by id and treats a missing key as “no series”, which is exactly what a heartbeat or a browser check has.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Request body for the batched sparkline endpoint.
object
Monitor ids to fetch response-time samples for. Ids that are not HTTP monitors, or that belong to another account, are simply absent from the response.
Example generated
{ "monitor_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ]}Responses
Section titled “ Responses ”Response-time samples keyed by monitor id
Too many monitor ids in one request
Missing or invalid authentication
Internal server error