send whatsapp api using php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mona.loliee
Forum Newbie
Posts: 1
Joined: Sat Nov 27, 2021 6:21 pm

send whatsapp api using php

Post 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;
Fariba.Cristhian
Forum Newbie
Posts: 1
Joined: Mon Jan 10, 2022 3:27 am

Re: send whatsapp api using php

Post by Fariba.Cristhian »

cool , I really use ultramsg.com

Fantastic service for WhatsApp API
Post Reply