Introduction
This document provides HTTP specification including connection to advance messaging systems server, bind options and specification for sending sms over HTTP. This HTTP API used to sending SMS, collecting delivery reports along.
HTTP API
The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. This is the foundation for data communication for the World Wide Web (i.e. internet)
HTTP is a generic and stateless protocol which can be used for other purposes as well using extensions of its request methods, error codes, and headers. This document provides developers with instructions for integrating SMS messaging services into various solutions using HTTP API.
This HTTP API can be used in sending SMS, collecting delivery reports along with HTTP API specification .
You can send upto 16 numbers on each request . you can use both GET and POST methods to send sms.
Users can Use Following Services via HTTP API:
Parameters:
Parameter Name |
Description |
username |
username |
password |
password |
type |
1 , 2 |
mno |
mobile numbers separated by comma( , ) (Destination Number or Comma separated Destination Numbers (Including Country Code without 00 or +) |
sid (numeric/alpha) |
sender ID or sender name |
message |
Text Message |
Message Type:
Type |
Description |
Length |
1 |
Normal text message ( English) |
160 Characters |
2 |
Unicode Message (1001D00E00) |
70 Characters |
For message type 1:
For message type 2: (unicode)
On success you will get message ID:
Response : 2dd48d6a-08d2-446f-9d85-e3683d9b276a
Message ID :: which is used to get delivery report later
Errors Codes:
Error Description |
Error Code |
Invalid Message Type |
5551 |
Numeric sender less than 18 char |
5552 |
sender length minimum 6 digit/char |
5564 |
Alphanumeric sender less than 12 char |
5553 |
Invalid Parameters |
5554 |
To Many Numbers |
5555 |
Not Authorized |
5556 |
Invalid Values |
5557 |
Internal Error |
5559 |
Invalid Credits |
5558 |
Invalid login Details |
6000 |
Invalid Mobile Number |
5560 |
sender length minimum 4 digit/letters |
5564 |
Unknow Error |
5561 |
https://e-bulksms.com/sendsms/dlr?smscid=d4248487-9d91-454a-a138-63467ceded82
input parameter name = smscid
message id = d4248487-9d91-454a-a138-63467ceded82
Output:
status : DELIVRD, UNDELIV, Pending, SUBMITTED
https://e-bulksms.com/sendsms/user?userid=541560
input : user ID balance : 110000
using System;
using System.Collections.Specialized;
using System.Text;
using System.Web;
using System.Web.UI;
using (var wb = new System.Net.WebClient())
{
var data = new NameValueCollection();
data["username"] = "username";
data["password"] = "password";
data["type"] = "1"; // for unicode, use 2
data["sid"] = "342xxxxxxx";
data["mno"] = "342xxxxxxx"; //for multiple numbers - 342xxxxxxx,342xxxxxxx,342xxxxxxx,342xxxxxxx upto 15 numbers
data["message"] = "Testing sms using dot net";
data["dcs"] = "1";
var results = wb.UploadValues("https://e-bulksms.com/api/sendsms?", "POST", data);
string msgID = Encoding.UTF8.GetString(results);
}
//convert unicode exampe
public string textToUnicode(string message)
{
byte[] bt = Encoding.GetEncoding("UTF-16BE").GetBytes(message);
var hexString = BitConverter.ToString(bt);
hexString = hexString.Replace("-", "");
return hexString;
}
Callback URL Parameters
messageId
status
smstype
sender
toNumber
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;
namespace WebDLR1
{
public partial class ebulksms : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string MessageId = string.Empty;
string Source = string.Empty;
string Destination = string.Empty;
string Status = string.Empty;
string SubmitDate = string.Empty;
string DoneDate = string.Empty;
string statusCode = string.Empty;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
NameValueCollection nvc = Request.Form;
try
{
if (!string.IsNullOrEmpty(Request.QueryString["messageId"]))
{
MessageId = Request.QueryString["messageId"];
}
if (!string.IsNullOrEmpty(Request.QueryString["sender"]))
{
Source = Request.QueryString["sender"];
}
if (!string.IsNullOrEmpty(Request.QueryString["toNumber"]))
{
Destination = Request.QueryString["toNumber"];
}
if (!string.IsNullOrEmpty(Request.QueryString["status"]))
{
Status = Request.QueryString["status"];
}
string query = "insert into dlr_broadnet(MessageId, Source, Destination, Status, provider, date, reason) values('" + MessageId + "','cktl','" + Destination + "','" + Status + "', 'cktl', getdate(), '" + statusCode + "')";
SqlCommand cmd = new SqlCommand(query, con);
con.Open();
int i = cmd.ExecuteNonQuery();
if (i == 1)
{
con.Close();
JavaScriptSerializer js = new JavaScriptSerializer();
Context.Response.Write(js.Serialize("Ok"));
}
}
catch (Exception ex) { LogFile("Error : " + ex.Message); }
}
}
}
update soon