PHP code example of beedelivery / client-php-api-wa-me
1. Go to this page and download the library: Download beedelivery/client-php-api-wa-me library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
beedelivery / client-php-api-wa-me example snippets
$to = '556696852025'; // if it's a group, use full id ex: [email protected]
$status = 'composing'; // unavailable | available | composing | recording | paused
echo $whatsapp->sendPresence($to, $status);
$to = '556696852025'; // if it's a group, use full id ex: [email protected]
$text = 'Hi';
echo $whatsapp->sendText($to, $text);
$to = '556696852025'; // if it's a group, use full id ex: [email protected]
$url = ''; // your MP3 or OGG audio URL
$ptt = true;
echo $whatsapp->sendAudio($to, $url, $ptt );
$to = '556696852025'; // if it's a group, use full id ex: [email protected]
$url = '';
$type = 'image'; // image | video | audio | document
$caption = 'Hi';
echo $whatsapp->sendMedia($to, $url, $type, $caption);
$to = '556696852025'; // if it's a group, use full id ex: [email protected]
$name = 'CACHE SISTEMAS';
$number = '+556696883327';
echo $whatsapp->sendContact($to, $name, $number);
$to = '556696852025'; // if it's a group, use full id ex: [email protected]
$lat = 35.000;
$lon = 20.000;
$address = 'Rua do fulando';
echo $whatsapp->sendLocation($to, $lat, $lon, $address);
$to = '556696852025'; // if it's a group, use full id ex: [email protected]
$text = '😘';
$msgId = '';
echo $whatsapp->sendReaction($to, $text, $msgId);