Hi,
Been trying this PHP code and it won't work at all. Tried putting error reporting on and nothing is being thrown up.
Am I doing anything wrong?
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.triggercmd.com/api/run/triggerSave");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{"computer":"FR-CCTV-ANALYSIS","trigger":"armed"}");
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers[] = "Authorization: Bearer API Token removed";
$headers[] = "Content-Type: application/x-www-form-urlencoded";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>
Thanks a lot if anyone can give some insight!