簡體   English   中英

如何使用 ultramsg 和 PHP 將 whatsapp 消息發送到多個號碼

[英]How can I send whatsapp message to multiple numbers by using ultramsg and PHP

我正在嘗試使用Ultramsg.com使用 PHP 將 WhatsApp 消息發送到多個號碼

通過參考: https://docs.ultramsg.com/api/post/messages/chat

代碼是這樣的:

 <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.ultramsg.com/instance1xxx/messages/chat", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "token=exxxxxxxx&to=1408XXXXXX1 @c.us,1408XXXXXX2 @c.us&body=WhatsApp API on UltraMsg.com works good&priority=10", CURLOPT_HTTPHEADER => array( "content-type: application/x-www-form-urlencoded" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:". $err; } else { echo $response; }

但我收到了這個錯誤

"to": "元素的 'to' 格式錯誤 (1408xxxxxxx @c.us,1408xxxxxxx @c.us)。'to' 格式:14155552671@c.us 或 14155552671-441234567890@g.us"

我不明白這一點。

我認為應該嘗試在@c.us 之前刪除空間

您可以在此處查看 WhatsApp api 的完整文檔: Ultramsg 完整文檔

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM