1. Go to this page and download the library: Download jaxisdev/sdk-php 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/ */
jaxisdev / sdk-php example snippets
axis\Jaxis;
// 1. Inicializa el SDK
// Recomendado: un token de servicio por tenant emitido desde el panel admin v2,
// independiente de cualquier login de usuario -- pensado para integraciones
// servidor-a-servidor.
$jaxis = new Jaxis([
'serviceToken' => 'jaxis_sk_live_xxxxxx',
// Alternativa: login humano via Cognito (panel admin / scripts):
// 'auth' => ['username' => '[email protected]', 'password' => 'super-secret-password'],
]);
// 2. Envía un SMS
try {
$response = $jaxis->sms->send([
// Puede ser un string o un array: ['+1234567', '+9876543']
'to' => '+1234567890',
'text' => 'Welcome to Jaxis!',
]);
echo 'Message subid: ' . $response['subid'];
} catch (\Throwable $e) {
echo 'Failed to send SMS: ' . $e->getMessage();
}
// 3. Envía un mensaje de WhatsApp (templateId desde jaxis.templates -- propio o genérico)
$templateResponse = $jaxis->whatsapp->send([
'to' => '+1234567890',
'templateId' => 'tmpl_abc123',
'params' => ['nombre' => 'Ana'],
]);
echo 'Message ID: ' . $templateResponse['id'];
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.