/smsglobal-php-sdk

SMSGlobal.com PHP SDK for SOAP-API

Primary LanguagePHPMIT LicenseMIT

SMSGlobal PHP SDK

SMSGlobal.com PHP SDK for SOAP-API

Usage

Note: Your web server should support SOAP extension, JSON (json_encode(), json_decode() functions) and SimpleXML (simplexml_load_string() function)

Require SMSGlobal SDK

try {
    require_once "smsglobal.php";
} catch (Exception $e) {
	$e->getMessage();
}

Create SMSGlobal object and authenticate

Way 1. Pass username and password to authenticate.

$sms = new SMSGlobal("username", "password");

Way 2. Leave username and password empty and set ticket (if you have one) manually.

$sms = new SMSGlobal();
$sms->setTicket("2ba88aa3b6b550662358eod5eb138a72");

Way 3. Leave username and password empty and call validateLogin() method.

$sms = new SMSGlobal();
$sms->validateLogin("username", "password");

Send Message

$smsID = $sms->sendSms("YourCompanyName", "1888123456", "Hello World!");

Call methods

$myCredit = $sms->getCredit();
$smsBalance = $sms->getSmsBalance("US");
$sms->renewTicket();

Logout (expire ticket)

$myCredit = $sms->logout();

Log/Debug (information about all requests and responses)

print_r($sms->getLog());

Contributing

Feel free to fork, modify and pull commits ;) Open issues for any ideas or bug reports