1. Go to this page and download the library: Download rodrigowba/apiwha-php-sdk 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/ */
rodrigowba / apiwha-php-sdk example snippets
use APIWHA\SDK\Factory;
$apiKey = 'API_KEY';
$client = (new Factory)->create($apiKey);
use APIWHA\SDK\Client;
$apiKey = 'API_KEY';
$client = new Client($apiKey, new GuzzleHttp\Client);
use APIWHA\SDK\Message\Message;
use APIWHA\SDK\Message\Image;
use APIWHA\SDK\Message\Audio;
use APIWHA\SDK\Message\PDF;
$number = '555555555555';
$message = new Message($number, 'Text message');
$message = new Message($number, 'Text message', 'custom_data');
$response = $client->send($message);
// Image Url must start with http and end with .jpg or .png
$url = 'http://addrress/image.jpg';
$message = new Image($number, $url);
$response = $client->send($message);
// Audio Url must start with http and end .ogg
// Only OGG audio supported
$url = 'http://addrress/audio.ogg';
$message = new Audio($number, $url);
$response = $client->send($message);
// PDF Url must start with http and end with .pdf
$url = 'http://addrress/document.pdf';
$message = new PDF($number, $url);
$response = $client->send($message);