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

ActiveLibrary[API Development](/categories/api)

cecula/messaging-api
====================

A library for consuming the Cecula Messaging API.

v1.0.2(1y ago)039MITPHPPHP &gt;=7.4

Since Sep 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bbnplace/cecula-api-client)[ Packagist](https://packagist.org/packages/cecula/messaging-api)[ RSS](/packages/cecula-messaging-api/feed)WikiDiscussions main Synced 1mo ago

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

Cecula API Client
=================

[](#cecula-api-client)

Cecula API Client is a simple client for connecting your PHP application to Cecula Messaging platform to send SMS via A2P channel or your hosted sim.

Methods
-------

[](#methods)

- sendSms(array $data) Send an SMS to a single or multiple recipients.

Data Array Keys:

- recipients (array): An array of recipients' mobile numbers.
- text (string): Message content.
- sender (string): Pre-registered sender name.

Sample

```
$data = [
            'sender' => 'SENDER', // Note: this has to be pre-registered and approved
            'recipients' => ['2348XXXXXXXXX', '2348XXXXXXXXX'],
            'text' => 'Happy for another day',
        ];

```

Response: Status of the message delivery. sendBulkMessage(array $recipients, $message) Send SMS to multiple recipients.

Parameters: $recipients (array): List of phone numbers. $message (string): Message content. Response: Status of the bulk message delivery. getBalance() Retrieve the available balance for sending SMS.

Response: Current SMS balance on the Cecula platform.

How to Use
----------

[](#how-to-use)

Import Cecula API Client to your application using composer.

```
composer require cecula/messaging-api

```

Once the library is imported to your application ensure all dependencies are installed by running

```
composer install

```

and you're ready to go.

### Get Your Cecula API Key

[](#get-your-cecula-api-key)

To get your Cecula API Key, login to the [Cecula Messaging Platform](https://app.cecula.com). If you do not already have an account you can create one right now.

Once you've logged in to your account, navigate to the Settings menu and that should be the first thing you see. Copy the Live or Sandbox API Key.

### Test the Library

[](#test-the-library)

Having retrieved your API key, you are now ready to test run the library.

#### In a Procedural PHP Script

[](#in-a-procedural-php-script)

```
