This repository contains an unofficial open source PHP client for the BulkSMSCenter HTTP API
- Get a free BulkSMSCenter account
- The BulkSMSCenter API client for PHP requires at least PHP 5.4.
####Composer installation
- Download composer
- Require this package with composer:
composer require sevenymedia/bulksmscenter-http-api
- Or add
"sevenymedia/bulksmscenter-http-api": "~1.0"
manually to therequire
section of yourcomposer.json
and runcomposer install
.
{
"require": {
"sevenymedia/bulksmscenter-http-api": "~1.0"
}
}
####Manual installation
If you do not (want to) use Composer. You can git clone
or download this repository and include the client manually.
First, set up a BulkSmsCenter\Client
. Replace YOUR_BULKSMSCENTER_USERNAME and YOUR_BULKSMSCENTER_PASSWORD with your BulkSMSCenter credentials.
require 'bootstrap.php';
$client = new \BulkSmsCenter\Client(new \BulkSmsCenter\Auth(
'YOUR_BULKSMSCENTER_USERNAME',
'YOUR_BULKSMSCENTER_PASSWORD'
));
You might also need a BulkSmsCenter\Message
.
$message = new \BulkSmsCenter\Message([
'body' => 'TEXT_MESSAGE',
'recipient' => 'RECIPIENT_NUMBER',
'sender' => 'SENDER_NUMBER',
]);
You are now able to connect to the BulkSMSCenter API
// Send a message
$credits = $client->sendMessage($message);
// Get a message status
$credits = $client->getMessageStatus($message->getId());
// Retrieve your remaining credits
$credits = $client->getBalance();
Documentation for the framework can be found on the BulkSMSCenter website.
This client is open-sourced software licensed under the MIT license.