This document provides instructions for sending SMS messages using the SMSGATEWAYHUB SMS gateway via HTTP API. It details the required parameters for authentication and sending single, bulk, scheduled, and group messages. It also describes how to check delivery reports and balances. Various error codes are listed to help troubleshoot any issues.
1 of 6
More Related Content
Http api 3.0.1 smsgatewayuhb
1. Welcome to
SMSGATEWAYHUB
HTTP API Guide.
Introduction API
This document is to provide help and illustrations to users who wish to delivery SMS using
the SMSGATEWAYHUB SMS Gateway via the HTTP Protocol.
Accessing gateway through HTTP API is one of the best and the quickest ways to deliver
SMS messages. The HTTP 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.
2. Parameter Name Description
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).
Channel Message channel Promotional=1 or Transactional=2
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)
Text Your sms content
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)
Groupid group id for numbers
Note : Only 100 mobile numbers are allowed.
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
3. 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
Text :- Your sms content
160 characters 1 message
161 C 306 characters 2 messages
307 C 459 characters 3 messages
460 C 612 characters 4 messages
613 C 765 characters 5 messages
766 C 918 characters 6 messages
919 C 1071 characters 7 messages
1072 C 1224 characters 8 messages
1225 C 1377 characters 9 messages
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)
Groupid:- group id for numbers
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.
4. 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
http://login.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=WEBSMS&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"}]}
An Optional IP validation feature is also available for security of clients
who access the gateway via a Global Static IP
Sending a Multiple Messaging (BULK Messaging)
For sending Bulk SMS messages, the following URL, along with the required parameters, needs to be accessed
http://login.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=WEBSMS&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"}]}
Schedule SMS API
Schedule an SMS. Schedule an SMS so that it is sent at a future date with this application. Choose the date and
then enter the mobile phone number and a message. On the selected date, the SMS will be automatically sent.
http://login.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=WEBSMS&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"}]}
5. Group SMS API
http://login.smsgatewayhub.com/api/mt/SendSMS?APIKey=yourapicode&senderid=WEBSMS&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"}]}
Check Delivery API
For accessing delivery report for SMS messages sent during a particular date and
time duration, the following URL, along with the required parameters, needs to be
accessed
http://login.smsgatewayhub.com/api/mt/GetDelivery?APIKey=yourapicode&jobid=#######
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"}]}
Check Multiple Delivery API
http://login.smsgatewayhub.com/smsapi/mis.aspx?user=username&password=password&fromdate=m
m/dd/yyyy&todate=mm/dd/yyyy
Note: you need to use your UI User ID and Password
Check Balance API
You can Check your Balance by Using this API
http://login.smsgatewayhub.com/api/mt/GetBalance?APIKey=yourapicode
Response in XML: {"ErrorCode":"0","ErrorMessage":"Success","Balance":"Promo:0|Trans:0"}
6. API Error Code
Error Code Description
000 Success
001 login details cannot be blank
003 sender cannot be blank
004 message text cannot be blank
005 message data cannot be blank
006 error: generic error description
007 username or password is invalid
008 account not active
009 account locked, contact your account manager
010 api restriction
011 ip address restriction
012 invalid length of message text
013 mobile numbers not valid
014 account locked due to spam message contact support
015 senderid not valid
017 groupid not valid
018 multi message to group is not supported
019 schedule date is not valid
020 message or mobile number cannot be blank
021 insufficient credits
022 invalid jobid
023 parameter missing
024 invalid template or template mismatch
025 {Field} can not be blank or empty
026 invalid date range
027 invalid optin user
Thank you
For any Kindly of Support in API Please Mail Us at : support@smsgatewayhub.com or call :
7024770247