繁体   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