Configure Meta WhatsApp Webhook
Budget / Salary€8–30
TypeFreelance project
LocationRemote
Posted1 month ago
I have a WhatsApp Business account that is already running on Meta’s Cloud API.
When a customer send me a meesage, my webhook .php file is call and all work very well.
When I send a message to a customer (free text or template message) it works also very well.
The customer receive the message with no issue.
But my webhook.php is not called with "delivered" or "read" status.
Is it a problem with meta configuration form ?
My app is "published", I actived "messages" in WABA, customer has active option for "read" status.
I need to set up or adjust the subscription in the Meta for Developers dashboard so the webhook listens to messages events.
here is first part of my webhook.php
as you see even if meta call a feature that it isn't in my webhook, it write all in log file, but in my logfile there isn't anything about "delivered" or "read" events
// =========================================================================
// Imposta il fuso orario corretto
date_default_timezone_set('Europe/Rome');
// =========================================================================
// Il token segreto che inserirai anche su Meta Developers
define('VERIFY_TOKEN', 'xxxxxxxxxxxxxxxxx');
// Abilita file di log per debug (webhook_log.txt)
define('ENABLE_LOG', true);
// =========================================================================
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Legge il payload grezzo inviato da Meta
$rawPayload = file_get_contents('php://input');
// Scrive nel file di log se abilitato
if (ENABLE_LOG && !empty($rawPayload)) {
scriviLog("PAYLOAD RICEVUTO:\n" . $rawPayload);
}
// Rispondi IMMEDIATAMENTE 200 OK a Meta
// Se non rispondi entro 3 secondi, Meta ritenta l'invio all'infinito
http_response_code(200);
echo "EVENT_RECEIVED";
// Se Apache supporta fastcgi, chiude subito la connessione HTTP con Meta
// continuando l'elaborazione del database in background
if (function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
}
// Decodifica il JSON in arrivo
$data = json_decode($rawPayload, true);
if (!$data || !isset($data['entry'][0]['changes'][0]['value'])) {
exit;
}
$value = $data['entry'][0]['changes'][0]['value'];
When a customer send me a meesage, my webhook .php file is call and all work very well.
When I send a message to a customer (free text or template message) it works also very well.
The customer receive the message with no issue.
But my webhook.php is not called with "delivered" or "read" status.
Is it a problem with meta configuration form ?
My app is "published", I actived "messages" in WABA, customer has active option for "read" status.
I need to set up or adjust the subscription in the Meta for Developers dashboard so the webhook listens to messages events.
here is first part of my webhook.php
as you see even if meta call a feature that it isn't in my webhook, it write all in log file, but in my logfile there isn't anything about "delivered" or "read" events
// =========================================================================
// Imposta il fuso orario corretto
date_default_timezone_set('Europe/Rome');
// =========================================================================
// Il token segreto che inserirai anche su Meta Developers
define('VERIFY_TOKEN', 'xxxxxxxxxxxxxxxxx');
// Abilita file di log per debug (webhook_log.txt)
define('ENABLE_LOG', true);
// =========================================================================
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Legge il payload grezzo inviato da Meta
$rawPayload = file_get_contents('php://input');
// Scrive nel file di log se abilitato
if (ENABLE_LOG && !empty($rawPayload)) {
scriviLog("PAYLOAD RICEVUTO:\n" . $rawPayload);
}
// Rispondi IMMEDIATAMENTE 200 OK a Meta
// Se non rispondi entro 3 secondi, Meta ritenta l'invio all'infinito
http_response_code(200);
echo "EVENT_RECEIVED";
// Se Apache supporta fastcgi, chiude subito la connessione HTTP con Meta
// continuando l'elaborazione del database in background
if (function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
}
// Decodifica il JSON in arrivo
$data = json_decode($rawPayload, true);
if (!$data || !isset($data['entry'][0]['changes'][0]['value'])) {
exit;
}
$value = $data['entry'][0]['changes'][0]['value'];
Apply on Freelancer →
Project sourced from Freelancer.com. Applications happen directly on the original platform — we never collect your data.