This is an unofficial PHP sdk for uSendIt SMS gateway platform. For more information about request and response parameters, please refer to official documentation here.
Before you begin to use this SDK make sure that, you have already have an account at uSendIt. If not please create one.
The easiest way to install is using Composer.
composer require codeonweekends/usendit-php-sdk
Optionally you can download the repository directly to your project folder. Just click here.
Or clone the repository to your project folder.
git clone https://github.com/codeonweekends/usendit-php-sdk.git
There are two available methods to send SMS.
sendMessage()
The sendMessage()
methods is used when you need to schedule a single SMS.
// Create a new SMS object
$sms = new SMS(MSISDN, MOBILE_OPERATOR, MESSAGE);
//Instantiate USendIt object and set the username and password of your uSendIt account.
$uSendIt = new USendIt();
$uSendIt->setUsername('username');
$uSendIt->setPassword('password');
// Send the SMS
$response = $uSendIt->sendMessage($sms);
The sendMessage
method returns a ScheduleResult
object.