1

I have multiple business Facebook pages. I want to set the callback URL in Webhooks for all the pages to get the reviews and ratings.

When someone give the reviews and ratings in any of the pages. I should get the notification in our server from webhooks.

Is it possible to get the reviews and ratings by WebHooks?

Firstly, I successfully validated the callbackUrl of User Webhooks subscription with verify token option as shown below.

enter image description here

Below is the code I am using to get the response. While validating the Callback URL and I got the response $chanllenge and $verify_token.

$challenge = $_REQUEST['hub_challenge'];
$verify_token = $_REQUEST['hub_verify_token'];
if ($verify_token === 'my_custom_token') {
    $filePath = realpath('Dump/') . '/' . "facebook_if_inbound.txt";
    $file = fopen($filePath, "a+");
    $data = file_get_contents("php://input");
    $events = json_decode($data, true);
    fwrite($file, print_r($challenge.$verify_token.$events, true));
    fclose($file);
}else{
    $filePath = realpath('Dump/') . '/' . "facebook_else_inbound.txt";
    $file = fopen($filePath, "a+");
    $data = file_get_contents("php://input");
    $events = json_decode($data, true);
    fwrite($file, print_r($challenge.$challenge.$events, true));
    fclose($file);
}


$filePath = realpath('Dump/') . '/' . "facebook_response_inbound.txt";
$file = fopen($filePath, "a+");
fwrite($file, print_r($_POST, true));
fclose($file);

But When I am trying to Subscribe the likes, first_name and try to get the response nothing is coming from Webhooks URL.

Note: My app is in Live Mode.

0 Answers0