Webhooks Integration - Documentation

Programatically respond to downtime notifications

What are Webhooks?

Pinger Man can call an HTTP or HTTPS URL when a downtime or uptime event happens. You can use this HTTP web request to perform custom actions for your website.

Configuring a Webhook

You must create a contact of type Webhook and then select this web hook in the alerts section of your monitor.

The web hook call is sent as an HTTP POST request. The content type depends on whether you specify a query string in the URL, a JSON body or just a URL and path.

Option 1: If you don't specify a JSON body or query string, a default query string is sent. The query string contains keys and values corresponding to the variables shown below. The content-type of the request is application/x-www-form-urlencoded.

Option 2: If you specify a query string in the URL, the default query string is not sent. You can customize your query string by substituting the values with the variables. The variables will be replaced with their actual values in the web hook call.

Option 3: If you specify a JSON body, the default query string is not sent. Any query string you specify in the URL will be hardcoded and no substitution will take place. The JSON body you specify along with any variable substitutions is sent as data to the HTTP POST request. The content-type of the request is application/json.

Variables

  • *monitorId* - The unique ID of the monitor
  • *monitorUrl* - The URL for an HTTP or Keyword monitor
  • *monitorHost* - The host for a Ping or TCP monitor
  • *monitorPort* - The port for a Ping or TCP monitor
  • *monitorName* - The display name of the monitor
  • *contactName* - The display name of the contact
  • *eventType* - The type of the event (Up or Down)
  • *eventDuration* - The duration of the previous event in milliseconds
  • *occurredOn* - The unix timestamp when the event happened
  • *details* - The detail of the event