I am trying to build a chatbot for facebook workplace but I have got stuck while creating the webhook for the chatbot.
After entering the Callback URL and verify_token, its showing me the error as: Problem Setting Up Webhook Subscription We could not verify the webhook callback. Make sure your webserver is listening and reachable through the specified callback url.
The Callback URL is HTTPS secured one. Following is the code I have placed in the php file:
$verify_token = "token";
$hub_verify_token = null;
if(isset($_REQUEST['hub_challenge'])) {
$challenge = $_REQUEST['hub_challenge'];
$hub_verify_token = $_REQUEST['hub_verify_token'];
}
if ($hub_verify_token === $verify_token) {
echo $challenge;
}
The callback URL is getting called from the browser as well.