Page 1 of 1

send whatsapp api using php

Posted: Sat Nov 27, 2021 6:26 pm
by mona.loliee
I've been using ultramsg.com months ago
I built a chatbot and sent clients verification messages
The service is good, fast and worth a try



example and simple code

Code: Select all

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.ultramsg.com/{{instance ID}}/messages/chat/',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => 'token={{Token}}&to={{mobile number}}&body=Hello world',
    CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Re: send whatsapp api using php

Posted: Mon Jan 10, 2022 3:29 am
by Fariba.Cristhian
cool , I really use ultramsg.com

Fantastic service for WhatsApp API