Bulksms API

1. Introduction

BIEN KENYA BULK SMS is a high-quality SMS platform, enabling you to integrate any of your applications with our SMS message sending and receiving system. The main advantage of our system is its simplicity of implementation. The SMS message may have your company name or any phone number you own as sender name. Every message sent from our system has its own unique id, which allows you to receive confirmation of its delivery.

How to start

To start using our BULK SMS API, you need to create an account on the Bien Kenya website. Registration is completely free of charge. Your account is ready to use immediately after registration, but we recommend you to verify at least one sender name or number. The default name for all messages sent before verification is "INFOTEXT".

2. BULK SMS API

URL links needed for connecting with our application:
http://smssystem.bienkenya.com/sendsms.jsp
Messages should be sent as a HTTP GET or POST request to our system:

Parameters

user Username created on your Bien Kenya bulksms account
password Password for the above user
mobiles mobile number(s)towhich message will be delivered
sms sms text which you want to send to your customer
Optional Parameters
clientsmsid pass unique sms serial no (ex. 311)
groupname groupname which you have created in your bulksms account. If you want to send sms to particular group contacts then specify group name which you have made in your bulk sms account.
senderid sender id. If you pass sender id as a blank so it will take defaultsender id which will assign in your account.
scheduletime If you want to schedule the sms specify date & time in yyyy-mm-dd hh:mm:ss format
unicode If you want to send unicode sms pass value 1. If you do not provide it will take 0 mean non-unicode.

PHP cURL Example;

<?php
$url = 'http://smssystem.bienkenya.com/sendsms.jsp';
//Only change this part to reflect your given username, password, senderid, relace mobile with a valid mobile number and finally the sms. That's all you need to change.
$username = "test";
$password = "password";
$senderid = "INFOTEXT";
$mobile = "254726******";
$sms = "Hello World!";

////Do not change from this part unless you know what you're doing
$params = array('user' => $username,
'mobiles' => $mobile,
'password' => $password,
'senderid' => $senderid,
'sms' => $sms);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
// This should be the default Content-type for POST requests
//curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/x-www-form-urlencoded"));
$result = curl_exec($ch);
//this echo will give you the response message echo $result;
curl_close($ch);
?>

Example to call HTTP API:

http://smssystem.bienkenya.com/sendsms.jsp?user=username&password=password&mobiles=254726XXXXXX&sms=msgbody&unicode=1&clientsmsid=10001&groupname=any_xyz&senderid=Aruhat&scheduletime=2013-02-14 12:12:12

CompulsoryParameters;
  • user
  • password
  • mobiles
  • sms

Example;
http://smssystem.bienkenya.com/sendsms.jsp?user=username&password=password&mobiles=254726XXXXXX&sms=HelloWorld&senderid=INFOTEXT

Checking Balance

URL for Getting Current Balance:
You will call the below URL;
http://smssystem.bienkenya.com /bulksms/smscredit.jsp

Example in code;

<?php
$url = "http://smssystem.bienkenya.com /bulksms/smscredit.jsp";
$username = "test";
$password = "password";

////Do not change from this part unless you know what you're doing
$params = array('user' => $username,'password' => $password);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
// This should be the default Content-type for POST requests
//curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/x-www-form-urlencoded"));
$result = curl_exec($ch);
echo "Balance: ".$result;
//Echo if sending message erroronious
if(curl_errno($ch) !== 0) {
error_log('cURL error when connecting to ' . $url . ': ' . curl_error($ch));
}
curl_close($ch);
}?>


Expected response error if SMS not sent successfully;
0-10001 Limit Exceed
0-10002 Invalid Username Or Password
0-10003 Invalid Mobile
0-10004 Unknown
0-10005 Invalid Sender ID
0-10006 Enter mobilenoor Select group
0-10007 Invalid Group
0-1111 VersionNotSupported
Success Message;
1480873 Message sent successfully.