PHPackages                             ossycodes/nigeriabulksms-php - 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. ossycodes/nigeriabulksms-php

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

ossycodes/nigeriabulksms-php
============================

Nigeriabulksms REST API client for PHP

v1.1.0(2y ago)51701MITPHPPHP ^7.4|^8.0

Since Sep 21Pushed 2y ago2 watchersCompare

[ Source](https://github.com/ossycodes/nigeriabulksms-php)[ Packagist](https://packagist.org/packages/ossycodes/nigeriabulksms-php)[ Docs](https://github.com/ossycodes/nigeriabulksms-php)[ RSS](/packages/ossycodes-nigeriabulksms-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (1)

The official PHP library for Nigeriabulksms API
===============================================

[](#the-official-php-library-for-nigeriabulksms-api)

This repository contains the open source PHP client for Nigeriabulksms's API. Documentation can be found at:

[![Latest Version on Packagist](https://camo.githubusercontent.com/67ce5f23627cce9c96b46cebd2663e3e13f9b11e70c31e659ce49e0b7ff79e95/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f737379636f6465732f6e69676572696162756c6b736d732d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ossycodes/nigeriabulksms-php)[![Total Downloads](https://camo.githubusercontent.com/452521b1c06c8e12d3e14e748cbef6204a3e98edf7ad39ca7a08abbd849373b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f737379636f6465732f6e69676572696162756c6b736d732d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ossycodes/nigeriabulksms-php)[![GitHub Actions](https://github.com/ossycodes/nigeriabulksms-php/actions/workflows/main.yml/badge.svg)](https://github.com/ossycodes/nigeriabulksms-php/actions/workflows/main.yml/badge.svg)

Requirements
------------

[](#requirements)

- [Sign up](http://portal.nigeriabulksms.com/register/?referral=15292322) for a free Nigeriabulksms account
- after signing up, your username and password will be used for authenticating with the APIs
- Nigeriabulksms API client for PHP requires PHP &gt;= 7.4.

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

[](#installation)

#### Composer installation

[](#composer-installation)

- [Download composer](https://getcomposer.org/doc/00-intro.md#installation-nix)
- Run `composer require ossycodes/nigeriabulksms-php`.

#### Manual installation

[](#manual-installation)

When you do not use Composer. You can git checkout or download [this repository](https://github.com/ossycodes/nigeriabulksms-php/archive/master.zip) and include the Nigeriabulksms API client manually.

Usage
-----

[](#usage)

We have put some self-explanatory examples in the [src/Examples](https://github.com/ossycodes/nigeriabulksms-php/tree/master/src/Examples) directory, but here is a quick breakdown on how it works. First, you need to set up a **Nigeriabulksms\\Client**. Be sure to replace **YOUR\_USERNAME** and **YOUR\_PASSWORD** with your real credentials.

```
require 'autoload.php';

$config = \Ossycodes\Nigeriabulksms\Configuration::getDefaultConfiguration()
            ->setUsername('YOUR_USERNAME')
            ->setPassword('YOUR_PASSWORD')
            ->setTimeout(10) //optional defaults to 10
            ->setConnectionTimeout(2); //optional defaults to 2

$client = new \Ossycodes\Nigeriabulksms\Client($config);
```

That's easy enough. Now we can query the server for information. Lets use getting your balance overview as an example:

```
try {

    // Get your balance
    $balance = $client->balance->read();

    var_dump($balance);

} catch (\Ossycodes\Nigeriabulksms\Exceptions\AuthenticateException $e) {

    // That means that your username and/or password is incorrect
    echo 'invalid credentials';

}
catch (\Ossycodes\Nigeriabulksms\Exceptions\BalanceException $e) {

    // That means that your balance is insufficient
    echo 'insufficient balance';

}
catch (\Exception $e) {

 var_dump($e->getMessage());

}
```

Sending Text SMS Message

```
require_once(__DIR__ . '/../autoload.php');

$config = \Ossycodes\Nigeriabulksms\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD')
    ->setTimeout(10) //optional defaults to 10
    ->setConnectionTimeout(2); //optional defaults to 2

$client = new \Ossycodes\Nigeriabulksms\Client($config);

try {

    $message = new \Ossycodes\Nigeriabulksms\Objects\TextMessage();
    $message->sender = 'YOUR_SENDER_NAME';
    $message->recipients = '2342222222222';
    $message->body =  'body of text message goes in here'; //should be less than 160 characters

    //send the text sms message
    $response = $client->message->send($message);

    var_dump($response);

} catch (\Ossycodes\Nigeriabulksms\Exceptions\AuthenticateException $e) {

    // That means that your username and/or password is incorrect
    echo 'invalid credentials';

} catch (\Ossycodes\Nigeriabulksms\Exceptions\BalanceException $e) {

    // That means that your balance is insufficient
    echo 'insufficient balance';

} catch (\Ossycodes\Nigeriabulksms\Exceptions\RequestDeniedException $e) {

    // That means that you do not have permission to perform this action
    echo 'this action is not permitted';

} catch (\Exception $e) {

    var_dump($e->getMessage());

}
```

Documentation
-------------

[](#documentation)

Complete documentation, instructions, and examples are available at:

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Osaigbovo Emmanuel](https://github.com/ossycodes)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

How do I say Thank you?
-----------------------

[](#how-do-i-say-thank-you)

Please buy me a cup of coffee  , Leave a star and follow me on [Twitter](https://twitter.com/ossycodes) .

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

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

2

Last Release

960d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/82932703b154706ffc400d8319ed794db6567b1c2cb4f862cde814b0e442b88f?d=identicon)[ossycodes](/maintainers/ossycodes)

---

Top Contributors

[![ossycodes](https://avatars.githubusercontent.com/u/55060799?v=4)](https://github.com/ossycodes "ossycodes (61 commits)")

---

Tags

nigeriabulksmsphpsdksms-gatewayossycodesnigeriabulksms-php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ossycodes-nigeriabulksms-php/health.svg)

```
[![Health](https://phpackages.com/badges/ossycodes-nigeriabulksms-php/health.svg)](https://phpackages.com/packages/ossycodes-nigeriabulksms-php)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M315](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M290](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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