PHPackages                             vmosoti/bongatech-sms - 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. [API Development](/categories/api)
4. /
5. vmosoti/bongatech-sms

ActiveLibrary[API Development](/categories/api)

vmosoti/bongatech-sms
=====================

A PHP client library for BongaTech's API (http://bongatech.co.ke)

v2.0.1(9y ago)122MITPHPPHP &gt;=5.6.4

Since Mar 4Pushed 8y agoCompare

[ Source](https://github.com/vmosoti/bongatech-sms)[ Packagist](https://packagist.org/packages/vmosoti/bongatech-sms)[ RSS](/packages/vmosoti-bongatech-sms/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

BongaTech SMS
=============

[](#bongatech-sms)

[![Latest Stable Version](https://camo.githubusercontent.com/eacc0ca4154a056c1d7484f7a402475ddd10fd43309610d5f5c62852f48d80ca/68747470733a2f2f706f7365722e707567782e6f72672f766d6f736f74692f626f6e6761746563682d736d732f762f737461626c65)](https://packagist.org/packages/vmosoti/bongatech-sms)[![Latest Unstable Version](https://camo.githubusercontent.com/477fc2541e554766a354f3f59a03cd4071124e26aa8cf6d1f0c9ae1a91d79c7c/68747470733a2f2f706f7365722e707567782e6f72672f766d6f736f74692f626f6e6761746563682d736d732f762f756e737461626c65)](https://packagist.org/packages/vmosoti/bongatech-sms)[![StyleCI](https://camo.githubusercontent.com/b32c39b01740a1f4f819e7080b91938a39579ad7337626832709f7425a255cfd/68747470733a2f2f7374796c6563692e696f2f7265706f732f38333433313230342f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/83431204)[![Build Status](https://camo.githubusercontent.com/0e5165f3ded88d06e90e27bdb1ad164a58d734c723e99010853eabdffe069302/68747470733a2f2f7472617669732d63692e6f72672f766d6f736f74692f626f6e6761746563682d736d732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/vmosoti/bongatech-sms)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e43aff6dd38a0c2b0c2592d44509cdac2bc1cee80fe8ddebf74a7194c13c8d0e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f564d6f736f74692f626f6e6761746563682d736d732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/VMosoti/bongatech-sms/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/07a176c1831cb8b7b09cc62d28c363ef9bea17291d6678f6da95f4b2bd354539/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f35393866393765362d626234362d343838332d616531392d3239383230393236623038312f6d696e692e706e67)](https://insight.sensiolabs.com/projects/598f97e6-bb46-4883-ae19-29820926b081)[![Total Downloads](https://camo.githubusercontent.com/0798db475bff73c5c02e2fbbfa1d812a79ca04955b6b9ef22a0da72d31f94237/68747470733a2f2f706f7365722e707567782e6f72672f766d6f736f74692f626f6e6761746563682d736d732f646f776e6c6f616473)](https://packagist.org/packages/vmosoti/bongatech-sms)[![License](https://camo.githubusercontent.com/136316197dde4749adae93f1208e5a9175fe43100da9069346e216d895e4bdbc/68747470733a2f2f706f7365722e707567782e6f72672f766d6f736f74692f626f6e6761746563682d736d732f6c6963656e7365)](https://packagist.org/packages/vmosoti/bongatech-sms)

This is a PHP client library to be used with BongaTech's SMS API [See Bonga Tech's Website for more](http://bongatech.co.ke)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require vmosoti/bongatech-sms
```

Usage
-----

[](#usage)

### Providing variables

[](#providing-variables)

The Config class requires to fetch some variable from the system environment. These variables are the ones used in initialization of the SMS class. In your .env file:

```
BONGATECH_USER_ID=
BONGATECH_PASSWORD=
BONGATECH_SENDER_ID=
BONGATECH_CALL_BACK_URL=

```

### Initializing the SMS class

[](#initializing-the-sms-class)

To initialize:

```
$sms = new  \VMosoti\BongaTech\SMS();
```

or simply use the magic helper function:

```
sms()  // you have the SMS object
```

### Recipients and Messages

[](#recipients-and-messages)

Each of them is an array of arrays. i.e

```
$recipients = array(
        array(
            'MSISDN' => '0722123456',
            'LinkID' => '',
            'SourceID' => 'your source id here'
        ),
        array(
            'MSISDN' => '0775345678',
            'LinkID' => '',
            'SourceID' => 'source id for this here'
        )
    );
```

and messages

```
$messages = array(
        array(
            'Text' => 'Message 1 goes here'
        ),
        array(
            'Text' => 'Message 2 goes here'
        )
    );
```

### Sending to a single Recipient

[](#sending-to-a-single-recipient)

```
$message = array(
        array(
            'Text' => 'This message is for a single recipient'
        )
    );

$recipient = array(
        array(
            'MSISDN' => '0722123456',
            'LinkID' => '',
            'SourceID' => 'your source id here'
        )
    );

$response = $sms->bulk()->toOne()->send($recipient, $message);
```

or use helper function

```
$response = sms()->bulk()->toOne()->send($recipient, $message);
```

The above returns a single [Response](https://github.com/VMosoti/bongatech-sms/blob/master/src/Response.php) object

### Sending same sms to many recipients

[](#sending-same-sms-to-many-recipients)

```
$message = array(
        array(
            'Text' => 'This message goes to many recipients'
        )
    );

$recipients = array(
        array(
            'MSISDN' => '0722123456',
            'LinkID' => '',
            'SourceID' => 'source id for recipient 1'
        ),
        array(
            'MSISDN' => '0713678900',
            'LinkID' => '',
            'SourceID' => 'source id for recipient 2'
            ),
    );

$responses = $sms->bulk()->toMany()->send($recipients, $message);
```

### Sending different sms to each recipient

[](#sending-different-sms-to-each-recipient)

```
$messages = array(
        array(
            'Text' => 'This is message for recipient 1'
        ),
        array(
             'Text' => 'This is message for recipient 2'
        )
    );

$recipients = array(
        array(
            'MSISDN' => '0722123456',
            'LinkID' => '',
            'SourceID' => 'source id for recipient 1'
        ),
        array(
            'MSISDN' => '0713678900',
            'LinkID' => '',
            'SourceID' => 'source id for recipient 2'
            ),
    );

$responses = $sms->bulk()->toMany()->send($recipients, $messages);
```

The above two examples returns an array of the [Response](https://github.com/VMosoti/bongatech-sms/blob/master/src/Response.php) object. Thus:

```
foreach($responses as $response){
$response->getCode();
------
}
```

### Querying SMS units balance

[](#querying-sms-units-balance)

```
$response = SMS::getBalance();
```

or just throw in the helper function

```
get_balance();
```

`$response` is [Response](https://github.com/VMosoti/bongatech-sms/blob/master/src/Response.php) object. thus

```
$response->getBalance()
```

Delivery Reports
----------------

[](#delivery-reports)

In your callback,

```
$response = \VMosoti\BongaTech\DeliveryReport::get();
```

It returns [Response](https://github.com/VMosoti/bongatech-sms/blob/master/src/Response.php) object,

thus:

```
$response->getReport();
$response->getMessageID();
$response->getCorrelator();
$response->getSourceID();

```

See all possible reports [here](DELIVERYREPORTS.md)

Exceptions
----------

[](#exceptions)

catch `\VMosoti\BongaTech\Exceptions\BongaTechException;`

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Suggestions, pull requests , bug reporting and code improvements are all welcome. Feel free to get in touch.

Security
--------

[](#security)

If you discover any security related issues, please email .

Credits
-------

[](#credits)

- [Vincent Mosoti](https://github.com/vmosoti)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity61

Established project with proven stability

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 ~14 days

Total

4

Last Release

3311d ago

Major Versions

v1.0.1 → v2.0.02017-03-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bfe4c3ad381cdb2390a61370eb50969db196084c003fa7b32244969ed4c9901?d=identicon)[vmosoti](/maintainers/vmosoti)

---

Tags

bongatechphpphp-librarysmssms-apisms-clientsms-gatewaysmsgatewaybongatech

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vmosoti-bongatech-sms/health.svg)

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

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

59914.4M61](/packages/mollie-mollie-api-php)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[mobizon/mobizon-php

A PHP library for communicating with the Mobizon API. Mobizon is a powerful SMS gateway and online marketing tools.

18115.1k1](/packages/mobizon-mobizon-php)

PHPackages © 2026

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