Php WhatsApp API для чтения сообщений, нужен сценарий для того же [закрыто]Php

Кемеровские программисты php общаются здесь
Ответить
Anonymous
 Php WhatsApp API для чтения сообщений, нужен сценарий для того же [закрыто]

Сообщение Anonymous »

Я знаю, как отправить сообщение через PHP. Код API WhatsApp приведен ниже:

Код: Выделить всё

$phone_number = "MOBILENUMBER"; // The phone number of the recipient in international format
$message_text = "Hello, this is a test message from the WhatsApp Business API!"; // The message text

$api_endpoint = 'https://graph.facebook.com/v20.0//messages';
// for more details https://developers.facebook.com/docs/whatsapp/business-management-api/get-started/

$api_token = "YOUR_TOKEN_HERE"; // Replace with your own API token
$data = array(
'messaging_product' => "whatsapp",
'to' => $phone_number,
// 'type' => "template",
// 'template' => array("name"=> "hello_world",'language'=>array("code"=>"en_Us"))
'type' => 'text',
'text' => array("preview_url"=> false,'body'=>$message_text)
);
$ch = curl_init($api_endpoint);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json', "Authorization: Bearer $api_token"));
$result = curl_exec($ch);
curl_close($ch);
Но я не понял, как читать сообщения WhatsApp. Пожалуйста, помогите мне в этом.

Подробнее здесь: https://stackoverflow.com/questions/789 ... t-for-same
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Php»