PHP code example of cachesistemas / classephpapiwame
1. Go to this page and download the library: Download cachesistemas/classephpapiwame 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/ */
$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
echo $whatsapp->sendAudio($to, $url);
$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 = 37.7749;
$lon = -122.4194;
$address = '123 Main St, San Francisco, CA';
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);