This is my code for send Personal or custom messages from WhatsApp API
==================================
$token='654464645321813vbnj3hj5g3jg1j5g3j131j3ghj1';
$telefono = '44596565965';
$url = 'https://graph.facebook.com/v16.0/109571185362363/messages';
$mensaje=''
.'{'
.'"messaging_product": "whatsapp",'
.'"recipient-type": "individual",'
.'"to": "'.$telefono.'",'
.'"type":"text",'
.'"text": '
.'{'
.'"preview_url": "false",'
.'"body": ""hello this is Test"'
.'}'
.'}';
$header = array("Authorization: Bearer " . $token, "Content-Type: application/json",);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POSTFIELDS, $mensaje);
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($curl), true);
print_r($response);
$status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
?>
================================
The problem is not send nothing, the code don´t show errors but not send message, if use tempates yes, but in this way no
The Result is this :
Array ( [messaging_product] => whatsapp [contacts] => Array ( [0] => Array ( [input] => 44596565965[wa_id] => 44596565965 ) ) [messages] => Array ( [0] => Array ( [id] => wamid.HBgLMzQ2MzI4Njc4NTgVAgARGBI1MUNBQUVGOTM3NkE1MjZFREIA ) ) )
I try all for find solution in the official API but don´t find nothing about this.