PHP code example of cserobiul / burst-transmitsms-api

1. Go to this page and download the library: Download cserobiul/burst-transmitsms-api 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/ */

    

cserobiul / burst-transmitsms-api example snippets


use Cserobiul\BurstTransmitsmsApi\TransmitsmsAPI;

php artisan vendor:publish cserobiul/burst-transmitsms-api


 'API_KEY' => 'b84f52054********f789b******c9f6',
 
 'API_SECRET' => 'b84******66579bb********ca87c9f6',


// set your api_key and api_secret from account settings
$apiKey = config('transmitsms_api.API_KEY');
$apiSecret = config('transmitsms_api.API_SECRET');

//create an instance
$api = new TransmitsmsAPI($apiKey, $apiSecret);

//write a message (as per your needed)
$message = 'This sms has been sent from Burst TransmitSMS API throught cserobiul/burst-transmitsms-api package.';
$number = '6104****54**';

//message sent  
$result = $api->sendSms($message, $number);

//check message has been sent or not
 if ($result->error->code == 'SUCCESS') 
    echo "Message Sent Successfully";
 } else {
    echo "Error: {$result->error->description}";
 }


//Coming soon next version


//follow official github docs
https://github.com/transmitsms/transmitsms-api-php-client