This is an unofficial client library for the TextNg SMS API. We provide an intuitive, stable interface to integrate TextNG SMS into your PHP project.
Install the library using Composer. Please read the Composer Documentation if you are unfamiliar with Composer or dependency managers in general.
$ composer require elmage/textng-php
use Elmage\TextNg\Configuration;
use Elmage\TextNg\Client;
$configuration = new Configuration($apiKey, $senderName);
$client = Client::create($configuration);
This is not intended to provide complete documentation of the API. For more detail, please refer to the Official Documentation.
Get Unit Balance
$response = $client->getBalance();
Send SMS
$response = $client->sendSMS($route, $phoneNumbers, $message, $bypassCode, $optionalParamsArray);
Send OTP
// This method accepts only one phone number
// and calls $client->sendSMS(..., [$phoneNumber], ...)
// passing the supplied phone number as the single element in an array
$response = $client->sendOTP($route, $phoneNumber, $message, $bypassCode, $optionalParamsArray);
Get Delivery Report
$response = $client->getDeliveryReport($reference, $req, $used_route);
$req
can take one of the 3 values all
, dnd
or success
(as specified in the API DOC)
Create Customer
$response = $client->createCustomer($customerName, $customerPhone, $categoryID);
$categoryID
is the category url ID generated for each url link you create. (as specified in the API DOC)
Remove Customer
$response = $client->removeCustomer($customerPhone, $categoryID);
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email [email protected] or use the issue tracker.
The MIT License (MIT). Please see License File for more information.