How To Use The Web Hook URL

Within contact groups you have the option of adding a Ping URL. These are quite simply URLs which our system will call if your website is down. Some of the way our clients use this feature include

  • Ping a URL to start a restart script on another server
  • Ping a URL to do a DNS change to move server
  • Ping a URL to log downtime in their own DB

The Ping URL will do a POST with the following post data

POST[‘Token’] = A hash of your username & API key, use this to verify.
POST[‘Status’] = Can either be Up or Down
POST[‘StatusCode’] = Will be the error status code; or 0 if timeout
POST[‘URL’] = The URL that can not be connected to
POST[‘IP’] = The IP which can not be connected to
POST[‘Tags’] = The tags included in the test
POST[‘Name’] = The name of the test
POST[CheckRate] = Check Rate for the test

 

The Token is as follows:

md5(username + apikey), with username being lowercase and no separator.

In addition to using POST you can also use replacement values within the Web Hook URL

To do this set your URL using the GET values of your choice and then use the following (including the |’s) which will be replaced by a URL encoded value of the response.

|URL| The test URL
|TOKEN| The token as per above
|NAME| The name of the test
|CODE| The status code returned by the test
|STATUS| The current Status (Up/Down)
|CHECKRATE| The check rate (in seconds)
|TAGS| Test tags, separated by a comma.

So for example you could set your web hook URL to http://example.com/callback.php?URL=|URL|&Token=|TOKEN|&Name=|NAME|&Code=|CODE|&Status=|STATUS|

 

Related Articles

Leave A Comment?