Alert Histories

Attributes

id (read-only) Unique ID for the alert history in our system.
start (read-only) The start time of this alert history incident.
end (read-only) The end time of this alert history incident, will be null if still in the incident.
subject (read-only) The subject of the alert email that was sent out.
alert (read-only) The ID of the alert this triggered on.
message (read-only) The saved email message that was generated when the alert triggered.
url (read-only) URL information about the requested item.

Available APIs

/api/alert_histories/

Lists recent alert histories. See above for the attributes each alert history contains.

GET

Gets Alert Histories. It gets up to “num” histories starting from “end” and going back “start”, based on the start time of the incident. You can also filter which alerts to get histories for by passing the filter parameter.

Arguments

  • limit (optional, default:2500, max:2500) – Sets the page size to a limit set by the user.
  • page (optional, default:0) – Retrieve the specific page of data of size limit.
  • end (optional, default:now) – Retrieve histories from this timestamp backwards. If not given, it gets the most recent data.
  • start (optional) – Don’t retrieve any histories before this date, if given.
  • filter (optional) – JSON list of alert id’s to only get histories for. ex: [45, 12, 6]
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/alert_histories/?num=2&filter=[1]
 
{
    "pagination": {
        "count": 3020, 
        "next": "https://wwws.appfirst.com/api/v5/alert_histories/?page=2", 
        "previous": null
    }, 
    data: [
        {
            "id": 234,
            "start": 1262304000,
            "end": None,
            "alert_id": 1,
            "message": "/alerting/email/1/234/",
            "url": "/api/v5/alert_histories/234/",
            "subject": "CPU on server1 exceeded threshold"
        },
        {
            "id": 123,
            "start": 1262104000,
            "end": 1262104500,
            "alert_id": 1,
            "message": "/alerting/email/1/123/",
            "url": "/api/v5/alert_histories/123/",
            "subject": "Page Faults on server1 below threshold"
        }
    ]
}

/api/alert_histories/{alert_history_id}/

View an alert history.

GET

Get info about a specific alert history, given by the alert_history_id in the URL. It takes no additional parameters.

curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/alert_histories/1/
{
    "id": 1,
    "start": 1262104000,
    "end": 1262104500,
    "alert_id": 1,
    "message": "/alerting/email/1/1/",
    "url": "/api/v5/alert_histories/1/",
    "subject": "Page Faults on server1 below threshold"
}

/api/alert_histories/{alert_history_id}/message/

View the email message content of an alert history.

GET

Get the email text (html, text, and sms versions) for a specific alert history, given by the alert_history_id in the URL. It takes no additional parameters.

curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/alert_histories/1/message/
{
    "id": 6136096,
    "subject": "Alert: No data received from host \"ip-172-31-3-39\"",
    "html": "{table}Email content in html format here",
    "json": "{\"body\": {\"data\": [{\"data\": \"Data has not been received from host \\\"ip-172-31-3-39\\\" for the 319.0 seconds from February 06 21:45:47 through February 06 21:51:06 UTC\", \"type\": \"text\", \"name\": \"summary\"}], \"type\": \"parent\", \"name\": \"body\"}, \"alert_type\": \"server_down\", \"subject\": \"Alert: No data received from host \\\"ip-172-31-3-39\\\"\"}",
    "text": "Email content in text format here",
    "view": "/api/alert_histories/61360961/message/html/"
}