HTTP API Reference
HTTP API Reference
SMSGATEWAYHUB
HTTP API Guide.
Accessing gateway through HTTP’s API is one of the best and the quickest ways to deliver
SMS messages. The HTTP’s API can be used to send various types of SMS messages
including normal text messages, Unicode messages, Flash SMS.
This document gives a detailed explanation of using the gateway through HTTP API.
ParaMeter DefiNition
The following table gives the list of parameters required for sending message through
SMSGATEWAYHUB Gateway using the HTTP API.
SMS API TIPS
Though you can communicate with our REST API using both POST and GET methods, we
recommend you to use POST method for better performance.
urlEncoding
If your messages seems to be garbled, make sure you are urlencoding the messaging while
using GET method to deliver. URLENCODING IS NOT REQUIRED FOR POST METHOD,
Hence we recommend using POST method.
DEBUG Help
Our Engineers are super cool and they shall help you to debug if you are facing any kind
of issues. Do not hesitate to get assistance from our engineers. They will be glad to help
you in your API integration.
Send SMS using HTTP/HTTPS Protocol. The HTTP/HTTPS interface to send Text SMS
Messages can be accessed using GET or POST. All parameters must be URL Encoded and
sent as UTF-8 text.
To test it on your preferred browser or using postman application, you can use the
following SMS HTTP API URLs to test our rest SMS API.
Account Parameters
APIKey Instead of the username and password you can use the API KEY for authentication of
account.
Message Parameters
senderid Approved sender id(6 characters string only).
Route Pass the route id in this parameter to route the message. Click Here for more
information regarding your routeid.
DCS Data coding value (Default is 0 for normal message, Set 8 for unicode sms)
Flashsms Flash message immediate display (Default is 0 for normal sms, Set 1 for
immediate display)
Number Recipient mobile number (pass with comma seprated if need to send on more
then one number)
Optional Parameters
Schedtime Schedule date and time for scheduling message (DateTime formate will be
2014/10/06 20:30:00 PM yyyy/mm/dd hh:mm:ss PM)
APIKey: - An application programming interface key (API key) is a code passed in by computer
programs calling an API (application programming interface) to identify the calling program, its
developer, or its user to the Web site.
Senderid: - The Sender-Id refers to the Alphanumeric Identity of the Sender. For India
analphanumeric sender-id (of maximum 6 characters) is accepted. International SMS can have
alphanumeric sender-id (of maximum 11 characters).
Channel:- Choose Route like Promotional = 1 or Transactional = 2 for OTP =OTP for
International =INT
Route:- Pass the route id in this parameter to route the message. Click Here for more
information regarding your routeid.
DCS: - Data coding value (Default is 0 for normal message, Set 8 for unicode sms)
Flashsms: - Flash message immediate display (Default is 0 for normal sms, Set 1 for immediate
display)
Number :- Recipient mobile number (pass with comma seprated if need to send on more then
one number) 91989xxxxxxx,91999xxxxxxx
Schedtime:- Schedule date and time for scheduling message (DateTime formate will be
2014/10/06 20:30:00 PM yyyy/mm/dd hh:mm:ss PM)
Note : Due to restrictions in the HTTP protocol, the following special characters must be encoded, as shown below, to avoid collision with reserved
HTTP characters.
Messaging API
Sending a Single Message
To send a single message of any type (normal text messages, Unicode messages,Flash Messages), the gateway
requires parameters like API KEY for authentication purpose in below URL format
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2
&DCS=0&flashsms=0&number=91989xxxxxxx&text=test message&route=clickhere
Response in XML :
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"919
89xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"91989xxxxxxx","MessageId":"Pf
ivClgH20iG6G5R3usHwA"}]}
Response in json :
{
"ErrorCode": "000",
"ErrorMessage": "Success",
"JobId": "236xxx416",
"MessageData": [
{
"Number": "91xxxxxxxxxx",
"MessageId": "CIhWJxxxxxxxh8LyULwGQw",
"Message": "Test from SMSGATEWAYHUB"
}
]
}
Note : An Optional IP validation feature is also available for security of clients
who access the gateway via a Global Static IP
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2
&DCS=0&flashsms=0&number=91989xxxxxxx,91999xxxxxxx&text=test message&route=clickhere
Response in XML :
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"919
89xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"91999xxxxxxx","MessageId":"Pf
ivClgH20iG6G5R3usHwA"}]}
Response in Json :
{
"ErrorCode": "000",
"ErrorMessage": "Success",
"JobId": "2369xx549",
"MessageData": [
{
"Number": "91xxxxxxxxxx",
"MessageId": "js5INguVLxxxxxQt6xrtw",
"Message": "Test from SMSGATEWAYHUB"
},
{
"Number": "91xxxxxxxxxx",
"MessageId": "r0evDxWxxxxxxqoECLDA",
"Message": "Test from SMSGATEWAYHUB"
}
]
}
https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2
&DCS=0&flashsms=0&number=91989xxxxxxx&text=test message&schedtime=2015/12/31 22:35:00
PM&route=clickhere
Response in XML:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"919
89xxxxxxx","MessageId":"BqTiw66A2UGLFV3DnwHFLQ"}]}
http://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=TESTIN&channel=2&
DCS=0&flashsms=0&number=91989xxxxxxx&text=test message&groupid=###&route=clickhere
Response in XML:
{"ErrorCode":"000","ErrorMessage":"Success","JobId":"20047","MessageData":[{"Number":"919
89xxxxxxx","MessageId":"mvHdpSyS7UOs9hjxixQLvw"},{"Number":"91999xxxxxxx","MessageId":"Pf
ivClgH20iG6G5R3usHwA"}]}
https://www.smsgatewayhub.com/api/group/getallgroups?APIKey=yourapicode
Response in XML:
{
"Status": true,
"Result": [
{
"GroupId": 10,
"GroupName": "Test"
},
Note : Make sure to use all api in Post Method :: Content type json only
https://www.smsgatewayhub.com/api/group/addnewgroup?APIKey=yourapicode&GroupName=Name
Response in XML:
{
"Status": true,
"Result": "Success:22358"
}
https://www.smsgatewayhub.com/api/group/
uploadcontacts?APIKey=yourapicode&GroupName=MYNEWGROUP&Numbers=91xxxxxxxxxx,91xxxxxxxxx,9
1xxxxxxxx
Response in XML:
{
"Status": true,
"Result": "Numbers added to group."
}
Response in XML:
{"ErrorCode":"0","ErrorMessage":"Success","MessageId":null,"DeliveryReports":[{"MessageId
":"mvHdpSyS7UOs9hjxixQLvw","DeliveryStatus":"Delivered","DeliveryDate":"2015-09-
28T06:17:00"},{"MessageId":"PfivClgH20iG6G5R3usHwA","DeliveryStatus":"Delivered","Deliver
yDate":"2015-09-28T06:17:00"}]}
https://www.smsgatewayhub.com/smsapi/mis.aspx?user=username&password=password&fromdate=mm
/dd/yyyy&todate=mm/dd/yyyy
https://www.smsgatewayhub.com/api/mt/GetBalance?APIKey=yourapicode
Response in XML:
{"ErrorCode":"0","ErrorMessage":"Success","Balance":"Promo:0|Trans:0"}
Shortlink API
https://www.smsgatewayhub.com/api/mt/SendSms
<SmsQueue>
<Account>
<User>userID</User>
<Password>Password</Password>
<SenderId>SMSHUB</SenderId>
<Channel>Trans</Channel>
<DCS>0</DCS>
<FlashSms>0</FlashSms>
<Route>2</Route>
</Account>
<Messages>
<Message>
<Number>91xxxxxxxxxx</Number>
<Text>Hello google #Link1# this is yourtube #Link2# thanks</Text>
</Message>
</Messages>
<Links>
<Links>
<Link>www.google.com</Link>
</Links>
<Links>
<Link>www.youtube.com</Link>
</Links>
</Links>
</SmsQueue>
Response in Jsn :
{
"ErrorCode": "000",
"ErrorMessage": "Success",
"JobId": "236xxx4430",
"MessageData": [
{
"Number": "91xxxxxxxxxx",
"MessageId": "4cK6vS6xxxxxdfN7mBlsOQ",
"Message": "Hello google sg0.co/ARid5 this is yourtube sg0.co/BRdDV5
thanks"
}
]
}
“XML API URL”
Post Method
URL: https://www.smsgatewayhub.com/api/mt/SendSms
<SmsQueue><Account><APIKey>yourapikey</APIKey><SenderId>WEBSMS</SenderId><Channel>2</Channel><DCS>0</DC
S><FlashSms>0</FlashSms><Route>1</Route></Account><Messages><Message><Number>9198981XXXXX</Number><Text
>Test Message</Text></Message></Messages></SmsQueue>
Response:
XML API:
<SmsQueue><Account><APIKey>yourapikey</APIKey><SenderId>WEBSMS</SenderId><Channel>2</Ch
annel><DCS>0</DCS><FlashSms>0</FlashSms><Route>1</Route></Account><Messages><Message>
<Number>9198765XXXXX</Number><Text>Hello World</Text></Message></Messages></SmsQueue>
• Response:
{
"ErrorCode": "000",
"ErrorMessage": "Success",
"JobId": "375887642",
"MessageData": [
{
"Number": "9198765XXXXX",
"MessageId": "KB9O7ys6BUKfpKUptuCfQQ",
"Message": "Hello world"
}
]
}
➢ Parameters details:
DCS=0 For English, DCS=8 For Unicode (Hindi, Marathi, Punjabi etc.)
Route=1 (Default)
Thank you