i am trying to configure webhook's callback URL on whatsapp with my API but it is not working Here is my API code

<?php
add_action('rest_api_init', function () {
register_rest_route(
         'test/v1',
         '/whatsapp',
         array(
             'methods' => 'GET',
             'callback' => 'whatsapp'
         )
     );
});

$hubVerifyToken = "123456789";

function whatsapp() {
    if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['hub.challenge']) && isset($_GET['hub.verify_token']) && $_GET['hub.verify_token'] === $hubVerifyToken) {
        // DO something
    }
}

this is error but I only get the error message as shown in the picture Looking forward to your guidance

0

There are 0 answers