https://github.com/adjemin/mtnsmscloud-php
PHP library for MTN SMS CLOUD API
https://github.com/adjemin/mtnsmscloud-php
smsapi smscloud
Last synced: 2 months ago
JSON representation
PHP library for MTN SMS CLOUD API
- Host: GitHub
- URL: https://github.com/adjemin/mtnsmscloud-php
- Owner: adjemin
- Created: 2020-06-22T14:04:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-26T15:19:36.000Z (over 5 years ago)
- Last Synced: 2025-08-19T07:00:57.125Z (6 months ago)
- Topics: smsapi, smscloud
- Language: PHP
- Homepage: https://smscloud.ci
- Size: 29.3 KB
- Stars: 3
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# MTN SMS CLOUD PHP
[](//packagist.org/packages/adjemin/mtnsmscloud) [](//packagist.org/packages/adjemin/mtnsmscloud) [](//packagist.org/packages/adjemin/mtnsmscloud) [](//packagist.org/packages/adjemin/mtnsmscloud)
This repository provides suitables tools for performing sms campaign. Actually, only Api's from MTN SMS CLOUD are embedded.
## Requirements
PHP 5.6.0 and later.
## Composer
You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:
```bash
composer require adjemin/mtnsmscloud
```
## Architecture
This repo has two main classes:
- **BaseApi** in [`./src/MtnSmsCloud/BaseApi.php`](./src/MtnSmsCloud/BaseApi.php)
- **MTNSMSApi** in [`./src/MtnSmsCloud/MTNSMSApi.php`](./src/MtnSmsCloud/MTNSMSApi.php)
The first class is used to perform POST and GET HTTP request.
The second one is used for MTN SMS.
## Instanciation
Be sure to check the namespace first.
```php
use MtnSmsCloud\MTNSMSApi;
/**
* Create a new Instance
*
* @param string $sender_id = The desired sender_id
* @param string $token = $token associated with $sender_id
*/
$msa = new MTNSMSApi($sender_id, $token);
/**
* Send a new Campaign
*
* @param array $recipients {Ex: ["225xxxxxxxx", "225xxxxxxxx"]}
* @param string $message
*/
return $msa->newCampaign($recipients, $message);
/**
* Retrieves on created Campaign
*
* @param string $campaign_id
* @param string $message
*/
return $msa->getCampaign($campaign_id, $message);
```
> Made with :heart: by Adjemin