Outbound API

API Common Parameters

API Actions

Note that all API parameters well sent over GET method to next link

Error Codes

 

Query Countries

Overview
SMSBulko API allows you to Query about available countries

Sample

Response
Country ID, Country Name , Country Code


236, Yemen, 967
226, United Arab Emirates, 971
219, Tunisia, 216
210, Syria, 963
205, Sudan, 249
200, Somalia, 252
191, Saudi Arabia, 966
178, Qatar, 974
165, Oman, 968
148, Morocco, 212
138, Mauritania, 222
135, Malta, 356
124, Libya, 218
121, Lebanon, 961
117, Kuwait, 965
111, Jordan, 962
103, Iraq, 964
81, Germany, 49
65, Egypt, 20
60, Djibouti, 253
47, Comoros, 269
17, Bahrain, 973
3, Algeria, 213

Senders

Overview
SMSBulko API allows you to Query your senders and add new senders

Parameters

Sample

Response (when action=1)

Mostafa, Pending
Ahmed, Activated

Response (when action=2)
Your request is successfully applied

 

Validation
 

Overview

SMSBulko API allows you to validate numbers you will send to.

Note that this page work with POST method

Parameters



Response

Note that Numbers is the true numbers
True:2
Duplicated:0
Wrong:1
Unreachable:2
Cost:0.027138
Numbers:
XXXXXXXXXXXXX,XXXXXXXXXXXX

 

Query groups

Overview

SMSBulko API allows you to Query about user available groups and its details

Parameters

Sample

Response (when action=1)

groupid, groupname,countryid,group_numbers_count

ex.

19, Saudia, 178,1
20, Kuwait, 114,5
32, Ahmed.Zayan, 61,2
39, hello, 61,1
40, hello2, 61,3
41, aaa, 61,2,
42, bbb, 61,2
45, ccc, 61,12


Response (when action=2)

groupid, groupname,grouptype,groupages,groupcountry,groupcity

numbers

ex.

58,new test,1,1,61,1

1010101010,1112131415

 

 

Send SMS

Overview

SMSBulko API allows you to send English and Arabic short messages to single mobile number or for your convenience to multiple mobile numbers at once.

Sample Code

English SMS (Single Number)

English SMS (Multiple Numbers)

Unicode SMS (Single Number)

Unicode SMS (Multiple Numbers)

 


Parameters


 

Inbound API


 

Note that all API parameters well sent over GET method To next link 


 


Test Inbound API Authentication

Overview

SMSBulko Inbound API allows you to Test Authentication

Sample

 

Messages Inbox

Overview

SMSBulko Inbound API allows you to Log the message to your smsbulko account inbox and forward
this data to the receiver page that you entered when creating an Inbound API

Sample

Note that all previous tasks and steps is already exist in our 2WaySMS App. 

 

How to Use Inbound API?

5- Now any message will be pushed over inbound API will be receive by smsbulko web portal
in inbox section, and also will be receive by 3rd party APP. receiver that placed in your configuration
 

Inbox

Overview

SMSBulko Inbound API allows your mobile Application to send your received messages

Note that the next parameters will sent to your receiver page over Post method

 

Receiver page example


<?php
//The data will received by your receiver page
$sender=$_POST['Sender'];
$country=$_POST['From_Country'];
$message=$_POST['Message'];
$date=$_POST['Message_Receive_Date'];
/* Customized code for example*/
//DB Connection
include 'connect_db.php';

//Insert data to your database
$sqlquery=" INSERT INTO `requests`(`Requested_National_ID`,`Request_Date`,
`Country_To_Relpy`,`Number_To_Relpy`,`Is_Replied`)
VALUES ('$message','$date','$country','$sender','0')";
$r= mysql_query($sqlquery);
?>
 

 

 
 
 
 

Authorize Application API

Overview

SMSBulko API allows you to use your SMSBulko account with any application registered with us.

General Parameters


 

Sample

Response

Your authorization completed successfully

Response (when wrong token)

This application is not registered with us

Note that all API parameters well sent over GET method to next link

Query if authorized by guid

Overview

SMSBulko API allows you to Query if application is authorized to use SMSBulko account

Sample

Response

1 (if guid or token not exist)

0 (ifguid and token exist but not authorized)

-1(if guid and token exist and authorized)

Username



API Common Parameters


API Actions


Error Codes

Topup

Overview

SMSBulko API allows you to charge your mobile balance over your SMSBulko account balance.

Parameters

Sample

Response (when action=1)

Value,Cost in $,Currency of Value

10,3.07,EGP

20,6.09,EGP

25,7.58,EGP

50,15.14,EGP

100,30.24,EGP

Response (when action=2)

Your Number Charged Successfully

 

Charge

Overview

SMSBulko API allows you to charge your SMSBulko account balance.

Parameters

Sample

Response

Congratulations, your account charged successfully

Balanceis: 100 Points

 


Query cities

Overview

SMSBulko API allows you to Query about available cities

Sample

Response

Country ID, City Name, City ID

61, Ad Daqahliyah, 1
61, Al Bahr al Ahmar, 2
61, Al Buhayrah, 3
61, Al Fayyum, 4
61, Al Gharbiyah, 5
61, Al Iskandariyah, 6
61, Al Ismailiyah, 7
61, Al Jizah, 8
61, Al Minufiyah, 9
61, Al Minya, 10
61, Al Qahirah, 11
61, Al Qalyubiyah, 12
61, Al Wadi al Jadid, 13
61, Ash Sharqiyah, 14
61, As Suways, 15
61, Aswan, 16
61, Asyut, 17
61, BaniSuwayf, 18
61, Bur Said, 19
61, Dumyat, 20
61, Kafr ash Shaykh, 21
61, Matruh, 22
61, Qina, 23
61, Suhaj, 24
61, JanubSina, 25
61, ShamalSina, 26

 

Query countries

Overview

SMSBulko API allows you to Query about available countries

Sample


Response

Country ID, Country Name , Country Code
236, Yemen, 967
226, United Arab Emirates, 971
219, Tunisia, 216
210, Syria, 963
205, Sudan, 249
200, Somalia, 252
191, Saudi Arabia, 966
178, Qatar, 974
165, Oman, 968
148, Morocco, 212
138, Mauritania, 222
135, Malta, 356
124, Libya, 218
121, Lebanon, 961
117, Kuwait, 965
111, Jordan, 962
103, Iraq, 964
81, Germany, 49
65, Egypt, 20
60, Djibouti, 253
47, Comoros, 269
17, Bahrain, 973
3, Algeria, 213

 

Query logs

Overview

SMSBulko API allows you to Query your logs

Parameters

Sample

Response (when action=1)

PriceInPoints,Phone_Numbers,Length, Sender_Name, Message_Time,Message_Text,
Message_Type,Message_Status
0.0279,1,1,Alafdl.com,2013-09-02 18:15:35,in the name of allah,API,Sent

Response (when action=2)

PriceInPoints,Phone_Numbers,Length, Sender_Name,Message_Time,Message_Text,
Message_Status
0.1787703,1,3,Alafdl.com,2012-12-27 10:25:02,تجربة من مصطفى أسيوط تجربة من مصطفى أسيوط,Sent

Response (when action=3)

Cost,Numbers,Hlr_Date,Hlr_Status
0.02,2,2013-09-09 13:12:09,Success

Response (when action=4)

Cost,Charged_Number,Product,Topup_Date,MessageText,Topup_Status
1.54,201141364147,5 EGP,2013-08-25 12:42:55,hello,Sent

Response (when action=5)

ServicePlan_ID,ChargedValue,Time,Charge_Type,Charge_Method,U2,Charged_Card
6,500,2013-08-26 16:14:43,Portal,Transfer,ues,


Manage Groups

Overview

SMSBulko API allows you to Add-Edit-Delete
Note that this page work with POST method

Parameters

Sample

Response (when action=1)

Group added successfully
True Numbers:…, Duplicate Numbers:…, Unreachable Numbers:…, Wrong Numbers:…

Response (when action=2)

Group updated successfully
True Numbers:…, Duplicate Numbers:…, Unreachable Numbers:…, Wrong Numbers:…

Response (when action=3)

Group deleted successfully

 


Query balance

Overview

SMSBulko API allows you to Query about SMSBulko account balance

Sample

Response

Your balance is: 100 Points
HLR Cost/Number is: 0.1 Points

 

Query groups

Overview

SMSBulko API allows you to Query about user available groups and its details

Parameters

Sample

Response (when action=1)

groupid, groupname,countryid,,group_numbers_count
ex.
19, Saudia, 178,1
20, Kuwait, 114,5
32, Ahmed.Zayan, 61,2
39, hello, 61,1
40, hello2, 61,3
41, aaa, 61,2,
42, bbb, 61,2
45, ccc, 61,12

Response (when action=2)

groupid, groupname,grouptype,groupages,groupcountry,groupcity
numbers
ex.
58,new test,1,1,61,1
1010101010,1112131415

 


Schedule

Overview

SMSBulko API allows you to Manage scheduled tasks

Parameters

Sample

 

Senders

Overview

SMSBulko API allows you to Query your senders and add new senders

Parameters

Sample

Response (when action=1)

Mostafa, Pending
Ahmed, Activated

Response (when action=2)

Your request is successfully applied

 

Validation

Overview

SMSBulko API allows you to validate numbers you will send to.
Note that this page work with POST method

Parameters

Response

Note that Numbers is the true numbers
True:2
Duplicated:0
Wrong:1
Unreachable:2
Cost:0.027138
Numbers:
XXXXXXXXXXXXX,XXXXXXXXXXXX

 

 

Send SMS

Overview

SMSBulko API allows you to send English and Arabic short messages to single mobile number or for your convenience to multiple mobile numbers at once or to group or multiple groups.

Parameters

Sample Code

English SMS (Single Number)

English SMS (Multiple Numbers)

Unicode SMS (Single Number)

Unicode SMS (Multiple Numbers)

Response

Successful, MSG_ID:1058464521, Total_true_numbers:15 , Balance:105.26

 

Query if authorized by username

Overview

SMSBulko API allows you to Query if application is authorized to useSMSBulko account

Sample

Response

1 (if username or token not exist)
0 (if username and token exist but not authorized)
-1(if username and token exist and authorized)

 

Query User Data

Overview

SMSBulko API allows you to Query about SMSBulko account data

Sample

Response

Customer_First,NameCustomer_LastName,Balance,Customer_Country,Customer_Country_ID, Customer_Email,Customer_Tel, Customer_Company

 

2Way SMS


You can use 2waysms service by follow the next steps
1- Add new Inbound Account
2- Enter your configration of inbound API which is (username, password and the custom receiver
page that will receive the data in parallel with SMSBulko Portal)

Example for reciver page of 3rd Party APP


<?
$sender=$_POST['Sender'];
$country=$_POST['From_Country'];
$message=$_POST['Message'];
$date=$_POST['Message_Receive_Date'];

include 'connect_sms.php';
include 'config.php';

$sqlquery=" INSERT INTO `requests`(`Requested_National_ID`,`Request_Date`,`Country_To_Relpy`,`Number_To_Relpy`,`Is_Replied`)
VALUES ('$message','$date','$country','$sender','0')";
$r= mysql_query($sqlquery);
if($r==true)
{
$sqlquery="SELECT * FROM id_details WHERE National_ID='$message'";
$r=mysql_query($sqlquery);
$row=mysql_fetch_object($r);
$res=mysql_num_rows($r);
if ($res==0)
{
$File_Name='temp.php';
$file="National ID Not Found";
$handle = fopen($File_Name,'w+');
fwrite($handle,$file);
fclose($handle);
exit ();
}
$id=$row->ID;
$city=$row->City;
$Address=$row->Address;
$Unicode_Address=$row->Unicode_Address;
$Is_Unicode=$row->Is_Unicode;
$to=str_replace('+', '', $sender);
if($Is_Unicode==0)
{
$msg=urlencode($Address);
$url="http://smsbulko.com/smsportal/user_api.php?api_ser=".$_CONFIG['api_serial']."&username=
".$_CONFIG['api_username']."&password=".$_CONFIG['api_password']."&unicode=0&country=
65&to=$to&msg=$msg&sender=".$_CONFIG['sender']."&request=5";
}
else
{
$url="http://smsbulko.com/smsportal/user_api.php?api_ser=".$_CONFIG['api_serial']."&username=
".$_CONFIG['api_username']."&password=".$_CONFIG['api_password']."&unicode=1&country=
65&to=$to&msg=$Unicode_Address&sender=".$_CONFIG['sender']."&request=5";

}
$File_Name='temp.php';
$file=$url;



$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT , "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)");
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$rawdata = curl_exec($ch);
curl_close($ch);
$data = explode(',', $rawdata);

$file=$file."\n$rowdata";
$handle = fopen($File_Name,'w+');
fwrite($handle,$file);
fclose($handle);

if ($data[0]=="Successful")
{
$sqlquery="UPDATE `requests` SET `Is_Replied` = '1' WHERE `Request_ID` = $id";
$r=mysql_query($sqlquery);
}

}

?>

3- Input inbound API Details (API Code, username, password) into installed Application
4- Download 2waysms Android Application From Google play store then install it.

5- Now any message will be pushed over inbound API will be receive by smsbulko web portal
in inbox section, and also will be receive by 3rd party APP. receiver that placed in your configuration
6- Open outbound API connection and then use it in sending any reply you need
 

 

 

SMS Bulko DLL User’s Guide

Requirement:

  • SMSBulko user control package from smsbulko.com
  • .NET Framework version 3.5 with MS Visual Studio 2008 or higher

Add the User Control to Your Project:

  • Open your Windows Forms application in Visual Studio
  • Make sure that you included the contents of the SMSBulko client in your application’s bin folder.
  • Inside the toolbox right click and choose “Choose Items…”

1

  • A “Choose Toolbox Item” dialog will appear, click Browse from the “.NET Framework Components” tab.

1

  • Browse to the SMSClient.dll which should be inside the application’s bin folder.

1

  • You should now see in the toolbox a new user-control named UESSMSClient

1

  • Now Add reference to the SMSClient.dll library from solution explorer by right clicking on References and choosing Add Reference.

1

  • Add Reference dialog will be opened for you to choose the library you wish to include in your project. Open Brows tab and navigate to SMSClient.dll which is in your project’s bin directory.

1

  • Now you can drag and drop the UESSMSClient user control to your windows form

1

Authorizing Your App:

  • Run the project a window like this will appear:

1

  • Click in the only button on the user control which says “Authorize” or its translated text to Arabic. That will open smsbulko.com using your system’s default browser.

1

  • Log-in to your account using your username and password (or create a new one if you don’t already have a SMSBulko.com account), that will open the following webpage:

1

  • Click Accept. Everything goes fine you should receive a message says “Your authorization completed successfully” like this:

1

  • Return to your application and click “Finish”.

1

  • You should receive a message like this:

1


Using the user control with code-behind (Not using the UI):

Note: To use the user control using only C# code you MUST be authorized the application at least once using the description above.

How to send multiple messages using SMSBulko DLL

This walkthrough will guide you to send multiple messages using SMSBulko DLL (I assume here that you added the dll to your project’s References) .
Let’s assume that you have 3 steps in your application logic to send messages to 3 numbers in 3 different countries. The first thing you need to do is to make a stack contains reference to your entire steps. For example you can make a stack like this:


// This declaration should be global since you will need to use
// it later from different parts in your code
    Stack<string> stepsStack = new Stack<string>();
    stepsStack.Push("Step1");
    stepsStack.Push("Step2");
    stepsStack.Push("Step3");


In your Form Load handler you now can start initializing SMSBulko client like this:

// This declaration should be global since you will need to use
// it later from different parts in your code
UESSMSClient client = new UESSMSClient();
client.LoadDefaultSettings();
client.SendBulkSMSProcess_Finished += new
UESSMSClient.SendBulkSMSProcess(client_SendBulkSMSProc
ess_Finished);

Now your are ready to start the sending process, so you can do something like:
private void btnSend_Click(object sender, EventArgs e)
{
String step = stepsStack.Pop();
if(step == “Step1”)
{
client.SendBulkSMS(65,
new string[] { "01222222222" }, "hello api");
// Or do that ever you want to do
}
else if(step == “Step2”)
{
client.SendBulkSMS(64,
new string[] { "0100000000" }, "hello api");
// Or do that ever you want to do
}
}


Notice that you need to handle SendBulkSMSProcess event which fires when the
send process is finished and the event handler you should create should look like
this:

void client_SendBulkSMSProcess_Finished(bool sent)
{
if(sent) //Sent successfully
{
btnSend_Click(null, null);
}
}

How to Force UI Culture

You can force SMSBulko User control to use a specific UI Language even if the control language settings were modified. This is useful when you need the user control’s language to always match your application’s UI language. To achieve this you need to set a value to the UICulture static variable in your application’s
main() method, for example to force use English UI add the following line of code in your application’s main() method:

static void Main()
{
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    UESSMSClient.UICulture = new
                       System.Globalization.CultureInfo("en-US");
    Application.Run(new frmControlWrapper());
}