PHPackages                             advanta\_africa/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. advanta\_africa/sms\_api

ActiveLibrary

advanta\_africa/sms\_api
========================

A PHP package for sending SMS using Advanta Africa APIs

v1.1.4(1y ago)115MITPHPPHP &gt;=7.4

Since Oct 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/harrykerry/advanta_sms_api)[ Packagist](https://packagist.org/packages/advanta_africa/sms_api)[ RSS](/packages/advanta-africa-sms-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

Advanta Africa SMS API Package
==============================

[](#advanta-africa-sms-api-package)

[![Version](https://camo.githubusercontent.com/d3ba3824965a0dfea85d875e562722adfd1e76f18d48a6083a6400d45bd9bcd7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d627269676874677265656e)](https://camo.githubusercontent.com/d3ba3824965a0dfea85d875e562722adfd1e76f18d48a6083a6400d45bd9bcd7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d627269676874677265656e)

Overview
--------

[](#overview)

The **Advanta Africa SMS API** package provides a simple interface for sending SMS, checking SMS balance and retrieving delivery reports using the Advanta Africa SMS APIs. This package allows you to easily integrate SMS functionalities into your PHP applications.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Configuration](#configuration)
    - [Sending SMS](#sending-sms)
    - [Sending OTP](#sending-otp)
    - [Sending OTP](#sending-sms-to-hashed-numbers)
    - [Sending Bulk SMS](#sending-bulk-sms)
    - [Getting Balance](#getting-balance)
    - [Getting Delivery Reports](#getting-delivery-reports)
- [Endpoints](#endpoints)
- [Author](#author)
- [License](#license)

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

[](#installation)

You can install this package via Composer. Run the following command:

```
composer require advanta_africa/sms_api
```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

To use the package, you need to provide the API credentials and the URL for the specific endpoint you want to interact with. You can pass the URL, API key, partner ID and sender ID directly when creating an instance of the package. These crednetials are accessible in your Advanta Africa SMS account. You can contact them for account creation

```
use AdvantaAfrica\SmsApi\SmsApi;

// Create an instance for sending SMS, OTP, and getting balance or delivery reports
$smsApi = new SmsApi('endpoint', 'apiKey', 'partnerId', 'senderId');
```

### Sending SMS

[](#sending-sms)

To send a single SMS, you can use the `sendSingleSmsPost` method for POST requests or `sendSingleSmsGet` for GET requests. Both methods accept mobile numbers and a message. Optionally, you can pass timeToSend to schedule messages (or pass null if not being scheduled) and a hashed key = true when sending to hashed numbers.

#### POST Example

[](#post-example)

You can pass a single number or a comma separated set of numbers (Numbers can start with 07, 0 or 254):

```
$response = $smsApi->sendSingleSmsPost('07xxxxxxxxxx,07xxxxxxxxx', 'Your message here', 'timeToSend', null);
```

#### GET Example

[](#get-example)

```
$response = $smsApi->sendSingleSmsGet('07xxxxxxxxxxx', 'Your message here','timeToSend', null);
```

### Send OTP Endpoint usage

[](#send-otp-endpoint-usage)

When using the otp endpoint, you can use the same `sendSingleSmsPost` method for POST requests or `sendSingleSmsGet` for GET requests. This is the same endpoint for sending SMS to hashed numbers. You will need to pass hashed key and value `true`. If not passed, it will be treated as a regular mobile number.

#### POST Example

[](#post-example-1)

To send an SMS to a hashed mobile number using OTP endpoint:

```
$response = $smsApi->sendSingleSmsPost('xxxxxxxxx', 'Your message here', 'timeToSend', 'true');
```

To send to a regular number using OTP endpoint:

```
$response = $smsApi->sendSingleSmsPost('07xxxxxxxxxx', 'Your message here', 'timeToSend',null);
```

#### GET Example

[](#get-example-1)

To send an SMS to a hashed mobile number using OTP endpoint:

```
$response = $smsApi->sendSingleSmsGet('xxxxxxxxxx', 'Your message here', 'Your message here', 'true');
```

To send to a regular number using OTP endpoint:

```
$response = $smsApi->sendSingleSmsGet('07xxxxxxxxxx', 'Your message here', 'Your message here',null);
```

### Sending Bulk SMS

[](#sending-bulk-sms)

To send multiple SMS messages in a single request, use the `sendBulkSms` method. This method requires an array of SMS details and is only available via POST.

#### Example

[](#example)

```
$smsList = [
    [
        'partnerID' => '12345',
        'apikey' => 'apiKey',
        'mobile' => '07xxxxxxxxxxxx',
        'message' => 'This is a test message',
        'shortcode' => 'xxxxxxxxxxxx'
    },
    [
        'partnerID' => '12346',
        'apikey' => 'apiKey',
        'mobile' => '07xxxxxxxxxxxx',
        'message' => 'This is a test message 2',
        'shortcode' => 'xxxxxxxxxxxx'
    ]
];

$response = $smsApi->sendBulkSms($smsList);
```

### Getting Balance

[](#getting-balance)

To check your SMS balance, you can use the `getBalancePost` method for POST requests or `getBalanceGet` for GET requests.

#### POST Example

[](#post-example-2)

```
$balanceResponse = $smsApi->getBalancePost();
```

#### GET Example

[](#get-example-2)

```
$balanceResponse = $smsApi->getBalanceGet();
```

### Getting Delivery Reports

[](#getting-delivery-reports)

To retrieve the delivery status of an SMS, you can use the `getDeliveryStatusPost` for POST requests or `getDeliveryStatusGet` for GET requests.

#### POST Example

[](#post-example-3)

```
$deliveryResponse = $smsApi->getDeliveryStatusPost('messageId');
```

#### GET Example

[](#get-example-3)

```
$deliveryResponse = $smsApi->getDeliveryStatusGet('messageId');
```

Endpoints
---------

[](#endpoints)

- **Sending Single SMS to 1 or multiple recipients**: `https://quicksms.advantasms.com/api/services/sendsms/`
- **Sending single SMS to 1 or multiple recipients via OTP route or sending to hashed mobile numbers**: `https://quicksms.advantasms.com/api/services/sendotp`
- **Sending Bulk SMS**: `https://quicksms.advantasms.com/api/services/sendbulk/`
- **Getting Balance**: `https://quicksms.advantasms.com/api/services/getbalance/`
- **Getting Delivery Report**: `https://quicksms.advantasms.com/api/services/getdlr/`

### Important Notes

[](#important-notes)

- For the **Send SMS** and **Send OTP** endpoints, both use the same methods (`sendSingleSmsPost` and `sendSingleSmsGet`), but they have different URLs and may require a hashed key for SMS requests sent to a hashed mobile number.
- When scheduling messages, pass the time as a string that can be converted to a Unix timestamp. If not needed, simply omit it.
- Ensure that the `partnerId` is always numeric.
- Mobile numbers can start with 254,07 or 0 for new prefixes
- When sending to hashed numbers, make sure the number before being hashed starts with 254xxxxxxxxxx

Author
------

[](#author)

Harold Kerry Omondi Email:

License
-------

[](#license)

This package is licensed under the MIT License.

---

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

7

Last Release

581d ago

### Community

Maintainers

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

---

Top Contributors

[![harrykerry](https://avatars.githubusercontent.com/u/87652658?v=4)](https://github.com/harrykerry "harrykerry (21 commits)")

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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