webhook
“whatsapp”,
“to” => $from,
“text” => [“body” => $reponse]
];
$ch = curl_init(“https://graph.facebook.com/v19.0/$PHONE_NUMBER_ID/messages”);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
“Content-Type: application/json”,
“Authorization: Bearer $ACCESS_TOKEN”
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
}
http_response_code(200);
exit;
}
?>
