I a working with ZOHO DESK API, which is working fine.
Now I am testing ZOHO WEBHOOK API.
To check webhook API I need to first create ZOHO webhook . I just want to receive contact details to my web app when any contact is created in ZOHO DESK
When I run below PHP script to create ZOHO webhook API I am getting response (400) "bad request".
<?php
$auth_token = '0e6934d204403eeaa67289xxxxxxxxxx'; //my_auth_token
$org_id=6xxxxxxxx; //my_organization_id
$ticket_data=array(
"Contact_Add"=> null,
);
$headers=array(
"Authorization: $auth_token",
"orgId: $org_id",
"contentType: application/json; charset=utf-8",
);
$ch= curl_init($url);
curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
curl_setopt($ch,CURLOPT_POST,TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS,$ticket_data);
$response= curl_exec($ch);
$info= curl_getinfo($ch);
if($info['http_code']==200){
echo "<h2>Request Successful, Response:</h2> <br>";
echo $response;
}
else{
echo "Request not successful. Response code : ".$info['http_code']." <br>";
echo "Response : $response";
}
curl_close($ch);
?>