1. Go to this page and download the library: Download excelle-insights/whatsapp 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/ */
excelle-insights / whatsapp example snippets
ExcelleInsights\WhatsApp\Facade\WhatsAppManager;
$whatsapp = new WhatsAppManager();
echo $whatsapp->getAuthUrl();
// Redirect the user to this URL for Meta Login
use ExcelleInsights\WhatsApp\Controller\OAuthController;
$oauth = new OAuthController($whatsapp);
echo $oauth->handleCallback();
// On success, all discovered WABAs are auto-linked
$whatsapp->setDirectToken('EAAT...');
$result = $whatsapp->sendText(1, '254712345678', 'Hello from WhatsApp API!');
echo $result->wam_id;
use ExcelleInsights\WhatsApp\Facade\WhatsAppManager;
$httpClient = new MyCustomHttpClient();
$whatsapp = new WhatsAppManager($httpClient);
$pdo = new PDO('mysql:host=...;dbname=...', 'user', 'pass');
$whatsapp = new WhatsAppManager(null, $pdo);
bash
# Using the package migrate script
php vendor/excelle-insights/whatsapp/migrate.php
# Or manually with Phinx
vendor/bin/phinx migrate -c vendor/excelle-insights/whatsapp/phinx.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.