Connect to your Webhook URL

I have created an account in Monday.com. When I integrate “When a new update posted send a webhook” add to board the URL check the URL test I got the error message - Failed to commuincate with the URL provided. In my PHP page I have integrated like this.

$now = date(“Y.m.d @ G:i”);
//capture the monday.com webhook challenge as a php object
$challenge_received = json_decode($GLOBALS[‘HTTP_RAW_POST_DATA’])->challenge;
// write the challenge to a log file for debugging
//error_log(“$now: JSON challenge: $challenge_received\n”, 3, “webhook.log”);
// prepare JSON response
$challenge_response = json_encode($challenge_received);
// initiate cURL
$ch = curl_init(“https://api.monday.com/v2/”);
$request = curl_init($api); // initiate curl object
curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($request, CURLOPT_POSTFIELDS, $challenge_response); // use HTTP POST to send form data
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment if you get no gateway response and are using HTTPS
curl_setopt($request, CURLOPT_FOLLOWLOCATION, true);
//curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt($ch, CURLOPT_POSTFIELDS, $challenge_response);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: application/json’));
// execute the request
$result = curl_exec($ch);
// execute the request
$result = curl_exec($ch);

What should I do to get this URL work?

Please help me to resolve this issue. Thanks in advance.