sevenymedia/bulksmscenter-http-api

This package is abandoned and no longer maintained. No replacement package was suggested.

This repository contains the open source PHP client for the BulkSMSCenter HTTP API

1.1.0.2 2016-10-17 18:25 UTC

This package is auto-updated.

Last update: 2022-04-28 17:54:05 UTC


README

Latest Stable Version Latest Unstable Version StyleCI Dependency Status Build Status SensioLabsInsight Total Downloads Software License

This repository contains an unofficial open source PHP client for the BulkSMSCenter HTTP API

Requirements

  • Get a free BulkSMSCenter account
  • The BulkSMSCenter API client for PHP requires at least PHP 5.4.

Installation

####Composer installation

composer require sevenymedia/bulksmscenter-http-api
  • Or add "sevenymedia/bulksmscenter-http-api": "~1.0" manually to the require section of your composer.json and run composer 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.

Usage

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();

Official Documentation

Documentation for the framework can be found on the BulkSMSCenter website.

License

This client is open-sourced software licensed under the MIT license.