How To Download Status & Check Data

Downloading Alertra data is easy using our API. You don't have to be a programmer either, you can download data using your browser alone. If you don't already have an API key, request one from support. Data will be returned in JSON format by default, but you can get it in XML and CSV as well. You can also specify the filename your browser should use to save the data.

In the examples, we use angle brackets < > to denote parameters you need to supply. Leave the brackets out when you plug in your data.

Device List & Status

Here are some examples of how to get a list of your monitored devices in different formats:

https://api.alertra.com/v1.1/devices?api_key=<YOUR-API-KEY>
https://api.alertra.com/v1.1/devices?api_key=<YOUR-API-KEY>&fmt=xml
https://api.alertra.com/v1.1/devices?api_key=<YOUR-API-KEY>&fmt=csv&filename=mydevices.csv

The list contains info about each device including the current Status (U=Up, D=Down) and the device_id which you'll need to download data for specific devices.

Check Data

Here's how to get the 25 most recent checks for a device:

https://api.alertra.com/v1.1/devices/<YOUR-DEVICE-ID>/checks?api_key=<YOUR-API-KEY>&fmt=xml

Here's an example of a JSON response:

[
  {
    "Location" : "Stockholm SWE",
    "Timestamp" : "2014-02-11T20:30:37-05:00",
    "ResultCode" : 1,
    "RequestTime" : 3520.77392578125,
    "PerfStat" : "Ok",
    "BlockTime" : 0,
    "DNSTime" : 0,
    "SSLTime" : 0,
    "ConnectTime" : 0,
    "TTFB" : 0,
    "TTLB" : 3520.77,
    "DataSize" : 0,
    "Kbps" : 0,
    "check_id" : "<CHECK_ID>"
  }
]

You can download a maximum of 100 checks at a time using the Limit parameter. Use the Offset parameter to step through the log.

https://api.alertra.com/v1.1/devices/<YOUR-DEVICE-ID>/checks?api_key=<YOUR-API-KEY>&Limit=100&fmt=xml
https://api.alertra.com/v1.1/devices/<YOUR-DEVICE-ID>/checks?api_key=<YOUR-API-KEY>&Offset=100&Limit=100&fmt=xml
https://api.alertra.com/v1.1/devices/<YOUR-DEVICE-ID>/checks?api_key=<YOUR-API-KEY>&Offset=200&Limit=100&fmt=xml

Event Data

Here's how to download the recent events for a device:

https://api.alertra.com/v1.1/devices/<YOUR-DEVICE-ID>/events?api_key=<YOUR-API-KEY>&Limit=100&fmt=xml

If you're interested in digging deeper into the API, read more here.