1. Go to this page and download the library: Download developingw/turbosmsua 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/ */
developingw / turbosmsua example snippets
use DevelopingW\TurboSMSua\API;
$smsApi = new API($_ENV['TURBOSMS_KEY']);
$balance = $smsApi->getUserBalance();
print_r($balance);
Array (
[balance] => 2106.42
)
use DevelopingW\TurboSMSua\API;
$smsApi = new API($_ENV['TURBOSMS_KEY']);
$senderList = $smsApi->getSMSDefaultSenders();
print_r($senderList);
use DevelopingW\TurboSMSua\API;
$smsApi = new API($_ENV['TURBOSMS_KEY']);
// This message will be sent at the specified time.
$message1 = $smsApi
->setStartTime(\DateTime::createFromFormat('d.m.Y H:i', '10.12.2023 9:00'));
->messageSend('380001111111', 'TEXT Message');
// This message will be sent via Viber.
$message2 = $smsApi
->setMode('viber')
->messageSend('380001111111', 'TEXT Message', 'MAGAZIN');
// This message will be sent via Viber and SMS.
// With an additional condition, the maximum lifespan of the Viber message is 60 seconds.
$message3 = $smsApi
->setMode('hybrid')
->setTTL(60)
->messageSend('380001111111', 'TEXT Message', 'YOUR SENDER');
print_r($message1);
print_r($message2);
print_r($message3);