Developers
Hi Buddie! | Login | Sign Up | Messaging Solutions | BBN
Applications Tools Documentations Support

Tools /
PHP SDK for HTTP API

Download PHP SDK

Introduction

The BBN SMS Gateway PHP SDK is built to make HTTP API Integration simpler for PHP Developers. Whilst working on sample code for developers using other JAVA and Visual Basic, if you are a web developer using any programming language other than PHP please refer to the HTTP API Integration Guide for full documentation.

 

Requirement

  • PHP Version 5.3+
  • Web Application Server

 

Getting Started

To get started with the BBN SMS Gateway PHP SDK for HTTP API Integration

  1. Download the PHP SDK zip file
  2. Extract the file to a suitable location on your computer.
  3. Copy the class folder into your project directory
  4. Refer to the example.php file in the extracted directory for sample calls on how to objectively call the BBN SMS Gateway class file.

 

Examples


Always include the BBN SMS Gateway file on the page where you want to run the messaging from
require_once 'class/bsgateway.php';

If you have an appid for the app you are integrating, instantiate an object using the sample code below. Set callback value to 1 if you wish to have delivery report for the the broadcast forwarded to your web app.

$config = array('appid'=>'123456','callback'=>1);
$messageObj = new BSGateway($config);

If you do not have an appid ignore then $config array and proceed to create your object as follows:

$messageObj = new BSGateway();

 

Test Login Credentials

$login_status = $messageObj->tryLogin('[email protected]', 'yourpassword');

 

Check Account Balance

$account_balance = $messageObj->checkBalance('[email protected]', 'yourpassword');

 

Sending Sample Text Without Message IDs

$response = $messageObj->sendMessage('[email protected]', 'yourpassword', 'SENDER', '234XXXXXXXXXX', 'Your Message', 0);

Since you did not provide any messageid, if the you have set Require DLR to 1 in app settings, gateway will return messageid for each recipient.

 

Sending Sample Text with Message IDs

$response = $messageObj->sendMessage('[email protected]', 'yourpassword', 'SENDER', '234XXXXXXXXXX', 'Your Message', 0,'AA23490909892343');

Multiple message ids should be seperated with commas. The number of message ids should be equal to the number or recipients.

 

Sending a Flash Text Message

$response = $messageObj->sendMessage('[email protected]', 'yourpassword', 'SENDER', '234XXXXXXXXXX', 'Your Message', 1);

You can optionally include your own messageid follow same rule above

 

Sending a Scheduled Message

$response = $messageObj->scheduleMessage('[email protected]', 'yourpassword', 'SENDER', '234XXXXXXXXXX', 'Your Message', 1345898220);

** The current version does not support delivery reporting for scheduled message.

 

Requesting Delivery Report

$response = $messageObj->loadDLReport($messageid);

** Delivery report is not available for apps that do not have a system generated appid.

 

For integration support, send an email to [email protected]

  • PHP SDK for HTTP API
  • Java SDK for HTTP API
  • BBN WebConnect Plugin

Technical Support

For integration issues, send the details including how to replicate the fault in an email to lab@bbnplace.com