New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

tooma/sms-api

Send and receive SMS anywhere in the world using our web services
34

Larablocks Analysis

tooma/sms-api works with any PHP project: the latest release (v0.0.5, Jun 15, 2017) doesn't depend on Laravel.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • No release in the last 12 months (last: Jun 15, 2017)
  • 0 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jun 15, 2017.
  • No releases in the last 12 months.
  • First released: Jun 13, 2017.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require tooma/sms-api
Latest Version:v0.0.5
PHP:>=7.0.0
License:MIT
Last Updated:Jun 15, 2017
Links: GitHub  ·  Packagist
Maintainer: Esofts

Tooma

Send and receive SMS anywhere in the world using our web services

Creating Account

Go to http://tooma.co.ke/user/auth/signup create your account

Once you have an account

Installation

run composer require tooma/sms-api

Usage

Retrive ApiKey

Once you get your API key, save it config file, please note you only run this function once, you can also get your API key by going to tooma.co.ke > settings > api

$tooma->onSuccess(function($response,$pagination){
         // Logic when Login is successfull
         $apiKey = $response->data->token;

      })->onError(function($response)
      {
          // Logic on Error 
      })->login(['username'=>'YOUR_USERNAME_OR_EMAIL','password'=>'YOUR_PASSWORD']);

Instantiate

$tooma = new Tooma("API_KEY");

Sending Message

Sending SMS is as easy as just

$parcel=[
      ['to'=>'+254XXXXXXXXX','message'=>'Greetings from Tooma'],
      ......
   ];
$tooma->onSuccess(function($response,$pagination){
         // Logic sending is successfull

      })->onError(function($response)
      {
          // Logic on Error 
      })->sendSms($parcel);

Sending Bulk Messages

Sending multiple message

$parcel=[
     ['to'=>'+254XXXXXXXXX','message'=>'Dear XXX Greetings from Tooma'],
     ['to'=>'+254YYYYYYYYY','message'=>'Dear YYY Greetings from Tooma'],
     ......
  ];
$tooma->onSuccess(function($response,$pagination){
        // Logic sending is successfull
      

     })->onError(function($response)
     {
         // Logic on Error 
     })->sendSms($parcel);

Retrive All Messages

To get all message logs

 $tooma->onSuccess(function($response,$pagination){
         $rows = $response->data;
         // save to db
         $pagination->getNext(); // call this to fetch the next page

      })->onError(function($response)
      {
          // Logic on Error 
      })->messageLogs();

Retrieve Message Status

To get message status

 $tooma->onSuccess(function($response,$pagination){
         

      })->onError(function($response)
      {
          // Logic on Error 
      })->messageStatus(['message_id(s)']);

Get account balancce

Getting balance just call balance as follows

$tooma->onSuccess(function($response,$pagination){
         // Logic sending is successfull
          echo "Your balance is $response->data->balance";

      })->onError(function($response)
      {
          // Logic on Error 
      })->balance();

Send Message from CSV files

You can also send message from a csv file as follows

 $csvPath = "path/to/your/csv.csv";

 $tooma->onSuccess(function($response,$pagination){
         // Logic sending is successfull
          echo "Your balance is $response->data->balance";

      })->onError(function($response)
      {
          // Logic on Error 
      })->withCsv($csvPath)
        ->withPhoneColumn('phone') //name of column with phone
        ->withTemplate('Dear :username_column_name your account balance is :balance_column_name')
        ->sendCsv();

Working with Message templates

You can also send message from a saved or new templat as follows

$data = [
  ['phone'=>'+254WWWWW','name'=>'','other_args'=>'args_val'];

];
$tooma->onSuccess(function($response,$pagination){
         // Logic sending is successfull
          echo "Your balance is $response->data->balance";

      })->onError(function($response)
      {
          // Logic on Error 
      })->withParams(['args1'=>'val']) //extra parametaer
        ->withTemplate('Dear :name your account balance is :balance_column_name') //or you can pass a template id
        ->sendFromTemplate($data);

Schedule Message

You can send SMS at a later stage by enableing schedule, the shedule format follows the cron format

$parcel=[
     ['to'=>'+254XXXXXXXXX','message'=>'Greetings from Tooma'],
     ......
  ];
$tooma->onSuccess(function($response,$pagination){
        // Logic sending is successfull
         echo "Your balance is $response->data->balance";

     })->onError(function($response)
     {
         // Logic on Error 
     })->schedule("FORMART")
       ->sendSms($parcel);

Support

Feel free to post your issues in the issues section.

Related Packages

mannysoft/laravel-sms

Sending SMS for multiple services

217 0
phpvcn/laravel-sms

Laravel SMS 是为 Laravel 提供国内发送短信服务的支持包

88 1
newway/turbo-sms

Package for TurboSMS service(http://turbosms.ua/)

32 0
mrabbani/laravel_infobip

Simple-SMS is a package made for Laravel to send/receive (polling/pushing) text...

9,652 11
simplesoftwareio/simple-sms

Simple-SMS is a package made for Laravel to send/receive (polling/pushing) text...

46,250 202

Version History

Version Released PHP License
v0.0.5 >=7.0.0 MIT
v0.0.4 >=7.0.0 MIT
v0.0.3 >=7.0.0 MIT
0.0.2 >=7.0.0 MIT
0.0.1 >=7.0.0 MIT