Webhooks

Webhooks are requests made by Apex Ping to a user-defined URL, the payload provided represents a triggered or resolved alert. Webhooks allow you to extend Apex Ping by performing any logic you wish.

Triggered state

The “triggered” state is a POST request and has the following format. The value of 2724 in this case is the average (avg) of the total response time (time_total), which is above the alert’s threshold of 2500.

{
  "triggered_at": "2016-05-24T20:10:57.657259407Z",
  "state": "triggered",
  "alert": {
    "id": 9,
    "type": "time_total",
    "stat": "avg",
    "window_duration": 5,
    "value": 2500,
    "op": "gt"
  },
  "check": {
    "id": 80,
    "name": "Axe Search",
    "method": "GET",
    "protocol": "http",
    "url": "www.axemusic.com/catalogsearch/result/?cat=0&q=sm58",
    "apdex_threshold": 700
  },
  "value": 2724
}

Resolved state

The “resolved” state is a POST request and has the following format. The value here is the new average total response time, as you can see it is below the alert threshold of 2500, thus the issue has been resolved.

{
  "triggered_at": "2016-06-01T03:17:11.579497Z",
  "resolved_at": "2016-06-01T03:21:10.865104243Z",
  "state": "resolved",
  "alert": {
    "id": 9,
    "type": "time_total",
    "stat": "avg",
    "window_duration": 5,
    "value": 2500,
    "op": "gt"
  },
  "check": {
    "id": 80,
    "name": "Axe Search",
    "method": "GET",
    "protocol": "http",
    "url": "www.axemusic.com/catalogsearch/result/?cat=0&q=sm58",
    "apdex_threshold": 700
  },
  "value": 810.625
}

Basic auth

Currently the recommended means of securing your webhook end-point is Basic Auth over HTTPS. In the future we provide secret support for signed requests.