PHP code example of kimulisiraj / sms-speeda-mobile-php

1. Go to this page and download the library: Download kimulisiraj/sms-speeda-mobile-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/ */

    

kimulisiraj / sms-speeda-mobile-php example snippets


$client = new \Kimulisiraj\SmsSpeedaMobile\SmsSpeedaMobile(
    apiKey:"your-username",
    apiSecret: "your-password",
);

$response = $client->send(
    to: 2567xxxxxxxx,
    mesage:'Hello, Kimulisiraj!'
)
return $response; 

$response->getStatus(); // OK | FAILED
$response->getMessage(); // Message sent successfully
$response->hasError(); // true | false
$response->getMessageId(); // I.E 12345

$client = Kimulisiraj\SmsSpeedaMobile::config([
    'apiKey' => 'your-api-key', //You can set and use env('SPEEDAMOBILE_SMS_API_ID')
    'apiPassword' => 'your-api-password', ////You can set and use env('SPEEDAMOBILE_SMS_API_PASSWORD')
]);

$response = $client->mesage('Hello, Kimulisiraj!')
        ->to('2567xxxxxxxx')
        ->send();

return $response 

  $client = new \Kimulisiraj\SmsSpeedaMobile\SmsSpeedaMobile(
    apiKey:"your-username",
    apiSecret: "your-password",
);

$client->getBalance() // ['BalanceAmount' => 1000, 'CurrenceCode' => 'UGX'],