2017 © Pedro Peláez
 

library sms-api

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

image

tooma/sms-api

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

  • Thursday, June 15, 2017
  • by Esofts
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Tooma

Send and receive SMS anywhere in the world using our web services, (*1)

Creating Account

Go to http://tooma.co.ke/user/auth/signup create your account, (*2)

Once you have an account, (*3)

Installation

run composer require tooma/sms-api, (*4)

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, (*5)

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

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

### Instantiate $tooma = new Tooma("API_KEY");```, (*7)

### 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, (*8)

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

```, (*9)

### 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, (*10)

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

```, (*11)

### 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, (*12)

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

```, (*13)

### Retrieve Message Status To get message status ``` $tooma->onSuccess(function($response,$pagination){, (*14)

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

```, (*15)

### 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";, (*16)

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

```, (*17)

### Send Message from CSV files You can also send message from a csv file as follows ``` $csvPath = "path/to/your/csv.csv";, (*18)

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

   })->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();

```, (*20)

### 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'];, (*21)

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

   })->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);

```, (*23)

### 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";, (*24)

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

```, (*25)

Support

Feel free to post your issues in the issues section., (*26)

The Versions

15/06 2017

dev-master

9999999-dev http://www.tooma.co.ke

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Elijah Mwangi

laravel yii2 sms send receive text messages tooma

15/06 2017

v0.0.5

0.0.5.0 http://www.tooma.co.ke

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Elijah Mwangi

laravel yii2 sms send receive text messages tooma

13/06 2017

v0.0.4

0.0.4.0 http://www.tooma.co.ke

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Elijah Mwangi

laravel yii2 sms send receive text messages tooma

13/06 2017

0.0.2

0.0.2.0 http://www.tooma.co.ke

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Elijah Mwangi

laravel yii2 sms send receive text messages tooma

13/06 2017

v0.0.3

0.0.3.0 http://www.tooma.co.ke

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Elijah Mwangi

laravel yii2 sms send receive text messages tooma

13/06 2017

0.0.1

0.0.1.0 http://www.tooma.co.ke

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Elijah Mwangi

laravel yii2 sms send receive text messages tooma