PHP code example of weboxlt / lutex-api-v1-php-sdk

1. Go to this page and download the library: Download weboxlt/lutex-api-v1-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/ */

    

weboxlt / lutex-api-v1-php-sdk example snippets


$smsClient = new eSMS\SmsClient('YOUR_USERNAME', 'YOUR_PASSWORD');
try {
    $smsHandler = $smsClient->sms();
    $smsHandler->setFrom('YOUR NAME');
    $smsHandler->addRecipient('RECIPIENT_NUMBER_1');
    $smsHandler->addRecipient('RECIPIENT_NUMBER_2');
    $smsHandler->setMessage('Hello world!');
	
    $data = $smsHandler->sendSimpleSMS();
    $smsHandler->destroy();
} catch (\Exception $e) {
    print( $e->getMessage());
}

$smsClient = new eSMS\SmsClient('YOUR_USERNAME', 'YOUR_PASSWORD');
try {
    $logsHandler = $smsClient->logs();
    $logsHandler->setLimit(10);
    $logsHandler->setMessageId('MESSAGE_ID');
    $logsHandler->setBulkId('BULK_ID');
    $logsHandler->setTo('PHONE_NUMBER');
    $logsHandler->setFrom('SENT_FROM');
    $logsHandler->setSentSince('2022-12-21');
    $logsHandler->setSentUntil('2022-12-25');
    $logsHandler->setGeneralStatus($logsHandler::STATUS_EXPIRED);

    $data = $logsHandler->get();
} catch (\Exception $e) {
    print( $e->getMessage());
}