oksweb/sms-api-php

PHP library for the OKSWeb SMS service.

v1.0.1 2020-10-17 17:34 UTC

This package is auto-updated.

Last update: 2025-04-18 03:39:41 UTC


README

The OKSWeb SMS API PHP library provides convenient access to the OKS SMS API from applications written in the PHP language.

Requirements

PHP 5.6.0 and later.

Composer

You can install the library via Composer. Run the following command:

composer require oksweb/api-sms-php

Don't forget to autoload it using Composer's autoload:

require_once('vendor/autoload.php');

Dependencies

The bindings require the following extensions in order to work properly:

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

Getting Started

Simple usage looks like:

require_once('vendor/autoload.php');

$OKSWebSMSGateway = new \OKSWeb\SMS\Gateway(
    'mKdG9gjFdmuPWbFAFn9wrAi3bwJ8V6QpNcU7sCQBF9SKtfcSbE8DSgy1Mg2fbjpp', // API Key
    1, // Server ID default to 1
);

$balance = $OKSWebSMSGateway->checkBalance();

$response = $OKSWebSMSGateway->sendQuickSMS(
    '+213512345678', // This is the phone number in the E.164 Format !
    'Hello World !', // Your message
);

TODO

  • Documentation
  • Testes
  • Atomisation

Development

Get [Composer][composer].

Install dependencies:

composer install

Install dependencies as mentioned above (which will resolve PHPUnit), then you can run the test suite:

./vendor/bin/phpunit

The library uses [PHP CS Fixer][php-cs-fixer] for code formatting. Code must be formatted before PRs are submitted, otherwise CI will fail. Run the formatter with:

./vendor/bin/php-cs-fixer fix -v .