PHPackages                             kemonai/zigatext-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. [Queues &amp; Workers](/categories/queues)
4. /
5. kemonai/zigatext-php

ActiveLibrary[Queues &amp; Workers](/categories/queues)

kemonai/zigatext-php
====================

Zigatext PHP library that helps to make API calls to Zigatext Cloud Messaging Platform for birthday contact and sms newsletter subscription and lots more.

v1.0.1(4y ago)140MITPHP

Since Aug 21Pushed 4y agoCompare

[ Source](https://github.com/kemonai/zigatext-php)[ Packagist](https://packagist.org/packages/kemonai/zigatext-php)[ Docs](https://zigatext.com)[ RSS](/packages/kemonai-zigatext-php/feed)WikiDiscussions main Synced 1w ago

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

zigatext-php
============

[](#zigatext-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0307f4d13027294d135f63dca54578100fd41c71ea84d218a5ff83aeb3e8e4f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b656d6f6e61692f7a696761746578742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kemonai/zigatext-php)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/d8a41fa8799a0da4f8ec2f5887e1714e202d9620c517ed2cae3a35ef6d2d1f42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b656d6f6e61692f7a696761746578742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kemonai/zigatext-php)

A PHP API wrapper for [Zigatext](https://zigatext.com/). This library helps to easily integrate Zigatext Messaging Platform into your PHP project.

[![Zigatext](img/zigatext.png?raw=true "Zigatext")](https://zigatext.com/)

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

[](#requirements)

- Curl 7.34.0 or latest (Unless using Guzzle)
- PHP 5.4.0 or latest
- OpenSSL v1.0.1 or latest

Install
-------

[](#install)

### Via Composer

[](#via-composer)

```
    $ composer require kemonai/zigatext-php
```

### Via download

[](#via-download)

Download a release version from the [releases page](https://github.com/kemonai/zigatext-php/releases). Extract, then:

```
    require 'path/to/src/autoload.php';
```

IMPORTANT
---------

[](#important)

This is the first implementation of Zigatext API version 1.

Usage
-----

[](#usage)

Instantiate Zigatext class and pass you ACCESS-KEY as an argument to the construct. Then you can can start calling resource methods to fulfill your requests

### 0. Prerequisites

[](#0-prerequisites)

Confirm that your server can conclude a TLSv1.2 connection to Zigatext's servers. Most up-to-date software have this capability. Contact your service provider for guidance if you have any SSL errors.

### 1. Initiate sending message

[](#1-initiate-sending-message)

When you submit message for sending our server queue's the message for delivery and after delivery your callback url is called to notify your system/website that your message has been sent.

```
    $zigatext = new Kemonai\Zigatext(ACCESS-KEY);
    try
    {
        $response = $zigatext->message->send(['sender' => 'php lib',
                                        'message' => 'it is awesome',
                                        'recipients' => '23470xxxxxxxx',
                                        'use_corporate_route' => true, // [true or false]
                                        'callback_url' => 'http://your-website/your-callback-url',
                                        ]);
        var_dump($response);

    } catch(\Kemonai\Zigatext\Exception\ApiException $e){
        print_r($e->getResponseObject());
        die($e->getMessage());
    }
```

#### send method parameters

[](#send-method-parameters)

- `sender` is your custom name/title for your message and is should not exceed 11 characters (space is also counted as character)
- `recipients` is the phone number(s) you are sending message to
- `message` is the content you want to send to your recipient(s)
- `use_corporate_route` can either be true or false. Value 'true' means that you want your message delivers to Do-Not-disturb (DND) numbers for countries that has dnd policy
- `callback_url` When you submit message for sending our server queue's the message for delivery and after delivery your callback url is called to notify your system/website that your message has been sent. Then you can use the message id passed as query string to retrieve delivery details. This parameter is optional in case you don't want to receive callback.

### 2. Scheduling message

[](#2-scheduling-message)

Most of the parameter are the same with `send` method above. Before scheduling message you need to include `time_zone_id`, call `$zigatext->timezone->list();` for the list of time zones and their ids.

```
    $zigatext = new Kemonai\Zigatext(ACCESS-KEY);
    try
    {
        $response = $zigatext->message->schedule(['sender' => 'php lib',
                                    'message' => 'it is awesome',
                                    'recipients' => '23470xxxxxxxx',
                                    'use_corporate_route' => true,
                                    'callback_url' => 'http://your-website/your-callback-url',
                                    'extras' => [[
                                        'deliver_at' => '2019-07-23 10:10',
                                        'time_zone_id' => 2,
                                    ]]]);
        var_dump($response);

    } catch(\Kemonai\Zigatext\Exception\ApiException $e){
        print_r($e->getResponseObject());
        die($e->getMessage());
    }
```

- `extras` accepts arrays of delivery times, in case you want your scheduled message to deliver at different times.
- `time_zone_id` You can call our time zone endpoint to get list of timezones and their ids. It's used to set at what timezone you want your scheduled message to delivery to your recipient(s).

### 3. Add Subscriber to your Newsletter list

[](#3-add-subscriber-to-your-newsletter-list)

To add subscriber from your system/website to your Newsletter list, first login to your Zigatext dashboard and create the newsletter list. Next call Newsletter `$zigatext->newsletter->list();` to pull your list with their ids.

```
    $zigatext = new Kemonai\Zigatext(ACCESS-KEY);
    try
    {
        $response =  $zigatext->newsletter->addSubscriber([
                                    'id' => 2, //sms newsletter id
                                    'name' => 'Chibuike Mba',
                                    'phone_no' => '23470xxxxxxxx']);
        var_dump($response);

    } catch(\Kemonai\Zigatext\Exception\ApiException $e){
        print_r($e->getResponseObject());
        die($e->getMessage());
    }
```

### 4. Add Subscribers to your Newsletter list

[](#4-add-subscribers-to-your-newsletter-list)

This is same as adding single subscriber but in this case you add multiple subscribers at once.

```
    $zigatext = new Kemonai\Zigatext(ACCESS-KEY);
    try
    {
        $response =  $zigatext->newsletter->addBulkSubscribers([
                                        'id' => 2, //sms newsletter id
                                        'subscribers' => [
                                            [
                                                'name' => 'Benjamin Akawu',
                                                'phone_no' => '23470xxxxxxxx'
                                            ],
                                            [
                                                'name' => 'Franklin Nnakwe',
                                                'phone_no' => '23480xxxxxxxx'
                                            ]
                                        ]
                                    ]);
        var_dump($response);

    } catch(\Kemonai\Zigatext\Exception\ApiException $e){
        print_r($e->getResponseObject());
        die($e->getMessage());
    }
```

### 5. Add Birthday Contact to your Birthday group

[](#5-add-birthday-contact-to-your-birthday-group)

To add contact from your system/website to your birthday group, first login to your Zigatext dashboard and create the birthday group. Next call Birthday `$zigatext->birthday->getGroupList();` to pull your groups with their ids and `$zigatext->month->list();` for months ids.

```
    $zigatext = new Kemonai\Zigatext(ACCESS-KEY);
    try
    {
        $response =  $zigatext->birthday->addContactToGroup([
                                        'group_id' => 7,
                                        'name' => 'Dennis Okonnachi',
                                        'phone_no' => '23470xxxxxxxx',
                                        'day' => 9,
                                        'month_id' => 1,
                                    ]);
        var_dump($response);

    } catch(\Kemonai\Zigatext\Exception\ApiException $e){
        print_r($e->getResponseObject());
        die($e->getMessage());
    }
```

### 6. Add Birthday Contacts to your Birthday group

[](#6-add-birthday-contacts-to-your-birthday-group)

This is same as adding single contact but in this case you add multiple contacts at once.

```
    $zigatext = new Kemonai\Zigatext(ACCESS-KEY);
    try
    {
        $response =  $zigatext->birthday->addBulkContactsToGroup([
                                        'group_id' => 7,
                                        'contacts' => [
                                            [
                                            'name' => 'Caleb Uche',
                                            'phone_no' => '23470xxxxxxxx',
                                            'day' => 9,
                                            'month_id' => 1,
                                            ],
                                            [
                                            'name' => 'Bernard Inyang',
                                            'phone_no' => '23480xxxxxxxx',
                                            'day' => 19,
                                            'month_id' => 3,
                                            ]
                                        ]
                                    ]);
        var_dump($response);

    } catch(\Kemonai\Zigatext\Exception\ApiException $e){
        print_r($e->getResponseObject());
        die($e->getMessage());
    }
```

7. Closing Notes
----------------

[](#7-closing-notes)

Generally, to make an API request after constructing a Zigatext object, Make a call to the resource/method thus: `$zigatext->{resource}->{method}()`; for gets, use `$zigatext->{resource}(id)` and to list resources: `$zigatext->{resource}s()`.

Currently, we support: 'message', 'newsletter', 'birthday', 'month', 'balance' and 'timezones'. Check our API reference(\[link-zigatext-api-reference\]\[link-zigatext-api-reference\]) for the methods supported. To specify parameters, send as an array.

Check [SAMPLES](SAMPLES.md) for more sample calls.

### MetadataBuilder

[](#metadatabuilder)

This class helps you build valid json metadata strings to be sent when making transaction requests.

```
    $builder = new MetadataBuilder();
```

#### Add metadata

[](#add-metadata)

To turn off automatic snake-casing of Key names, do:

```
    MetadataBuilder::$auto_snake_case = false;
```

before you start adding metadata to the `$builder`.

#### Build JSON

[](#build-json)

Finally call `build()` to get your JSON metadata string.

Change log
----------

[](#change-log)

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

Testing
-------

[](#testing)

```
    $ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CONDUCT](.github/CONDUCT.md) for details. Check our [todo list](TODO.md) for features already intended.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Kemonai Technologies](https://github.com/kemonai)
- [Chibuike Mba](https://github.com/chibexme)
- [Caleb Uche](https://github.com/KhalebOBrien)
- [Yabaconn](https://github.com/yabacon/paystack-php) - followed the style he employed in creating the [Paystack PHP Wrapper](https://github.com/yabacon/paystack-php)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

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

Total

2

Last Release

1542d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30c48b198a9b411cca10709abb49082ef89c473765b2de4304d310fa1f1f5ccb?d=identicon)[chibexme](/maintainers/chibexme)

![](https://www.gravatar.com/avatar/7ff0aa4d49a7dd071407befa787b75514777023728ab5fe7f4145bbe6f5cdc4c?d=identicon)[KhalebOBrien](/maintainers/KhalebOBrien)

---

Top Contributors

[![khaleb-dev](https://avatars.githubusercontent.com/u/28302748?v=4)](https://github.com/khaleb-dev "khaleb-dev (3 commits)")

---

Tags

birthdaybirthday-contactbirthday-messagebirthday-smsbulksmscontactmessagemessagingnewsletterphpsmssms-apisms-gatewai-apisms-messagessms-newslettersmscsubscriberzigatextmessageapismsmessagingcontactsubscribernewsletterbulk-smsbirthdaybirthday contactbirthday smsbirthday messagesms newsletterkemonaizigatext-phpzigatext

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kemonai-zigatext-php/health.svg)

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

###  Alternatives

[traderinteractive/mongo-queue

Message queue using MongoDB as a backend

4617.5k](/packages/traderinteractive-mongo-queue)

PHPackages © 2026

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