[July 2, 2017]
We’re slightly modifying the way our Uptime Webhook notifications work, please make the proper adjustments to your Webhook script.
You can find the new Webhook documentation here:
https://docs.hetrixtools.com/uptime-monitoring-webhook-notifications/
The changes you’d need to make to your Webhook script are very minimal.
If this is how your current capture method looks like:
<?php
$monitor_id = $_POST[‘monitor_id’];
$monitor_name = $_POST[‘monitor_name’];
$monitor_target = $_POST[‘monitor_target’];
$monitor_type = $_POST[‘monitor_type’];
$monitor_category = $_POST[‘monitor_category’];
$monitor_status = $_POST[‘monitor_status’];
// The rest of your script here
?>
Just modify it like so, to capture the new Webhook data:
<?php
// Get the JSON data
$json = file_get_contents(‘php://input’);
// Decode the JSON data into an array
$array = json_decode($json,true);
// Grab variables from the array
$monitor_id = $array[‘monitor_id’];
$monitor_name = $array[‘monitor_name’];
$monitor_target = $array[‘monitor_target’];
$monitor_type = $array[‘monitor_type’];
$monitor_category = $array[‘monitor_category’];
$monitor_status = $array[‘monitor_status’];
// The rest of your script here
?>
Other than that, the rest of your Webhook script should function just the same.
Currently, both the old and the new methods are working, so your Webhook script can capture either one.
The old method will be discontinued on 7 July 2017, after which point your Webhook script will not be notified with the old format anymore.
For further support you can always open a ticket on our website.