简体   繁体   English

如何使用 ultramsg 和 PHP 将 whatsapp 消息发送到多个号码

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

I am trying to send WhatsApp message to multiple numbers by using Ultramsg.com using PHP我正在尝试使用Ultramsg.com使用 PHP 将 WhatsApp 消息发送到多个号码

by reference: https://docs.ultramsg.com/api/post/messages/chat通过参考: https://docs.ultramsg.com/api/post/messages/chat

the code is like this:代码是这样的:

 <?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; }

but I am getting this error但我收到了这个错误

"to": "Wrong 'to' format for element (1408xxxxxxx @c.us,1408xxxxxxx @c.us). 'to' format: 14155552671@c.us or 14155552671-441234567890@g.us" "to": "元素的 'to' 格式错误 (1408xxxxxxx @c.us,1408xxxxxxx @c.us)。'to' 格式:14155552671@c.us 或 14155552671-441234567890@g.us"

I am not understanding this.我不明白这一点。

I think should try to remove space before @c.us我认为应该尝试在@c.us 之前删除空间

You can see full documentation for WhatsApp api here: Ultramsg full documentation您可以在此处查看 WhatsApp api 的完整文档: Ultramsg 完整文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM