PHPackages                             tooma/sms-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. tooma/sms-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

tooma/sms-api
=============

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

v0.0.5(9y ago)0341MITPHPPHP &gt;=7.0.0

Since Jun 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ElijahGM/tooma)[ Packagist](https://packagist.org/packages/tooma/sms-api)[ Docs](http://www.tooma.co.ke)[ RSS](/packages/tooma-sms-api/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (3)Versions (6)Used By (1)

Tooma
=====

[](#tooma)

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

Creating Account
================

[](#creating-account)

Go to  create your account

Once you have an account

Installation
============

[](#installation)

run `composer require tooma/sms-api`

Usage
-----

[](#usage)

### Retrive ApiKey

[](#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 &gt; settings &gt; 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

[](#instantiate)

` $tooma = new Tooma("API_KEY");`

### Sending Message

[](#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-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

[](#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

[](#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

[](#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

[](#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

[](#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

[](#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
-------

[](#support)

Feel free to post your issues in the issues section.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

3304d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c15a4181fc9ae5bef2ad3d22155544a07dd38c3c29e21da7cc134daf34d0c387?d=identicon)[Esofts](/maintainers/Esofts)

---

Top Contributors

[![ElijahGM](https://avatars.githubusercontent.com/u/918982?v=4)](https://github.com/ElijahGM "ElijahGM (7 commits)")

---

Tags

laravelsmssendyii2text messagesreceivetooma

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tooma-sms-api/health.svg)

```
[![Health](https://phpackages.com/badges/tooma-sms-api/health.svg)](https://phpackages.com/packages/tooma-sms-api)
```

###  Alternatives

[simplesoftwareio/simple-sms

Simple-SMS is a package made for Laravel to send/receive (polling/pushing) text messages. Currently supports CalLFire, EZTexting, Email Gateways, FlowRoute, LabsMobile, Mozeo, Nexmo, Plivo, Twilio, and Zenvia

20845.9k5](/packages/simplesoftwareio-simple-sms)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

123256.9k1](/packages/ellaisys-aws-cognito)[sunchayn/nimbus

A Laravel package providing an in-browser API client with automatic schema generation, live validation, and built-in authentication with a touch of Laravel-tailored magic for effortless API testing.

32041.3k](/packages/sunchayn-nimbus)[mrabbani/laravel_infobip

Simple-SMS is a package made for Laravel to send/receive (polling/pushing) text messages. Currently supports CallFire, EZTexting, Email Gateways, Mozeo, and Twilio.

114.1k](/packages/mrabbani-laravel-infobip)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.1k38](/packages/dreamfactory-df-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
