0% found this document useful (0 votes)
62 views

HTTP API Reference

This document provides instructions for using an SMS gateway's HTTP API to send SMS messages through various methods, including single messages, bulk messages, scheduled messages, and messages to groups. It defines the required parameters, gives examples of URLs and responses, and describes how to check delivery status and balances.

Uploaded by

Karthik S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

HTTP API Reference

This document provides instructions for using an SMS gateway's HTTP API to send SMS messages through various methods, including single messages, bulk messages, scheduled messages, and messages to groups. It defines the required parameters, gives examples of URLs and responses, and describes how to check delivery status and balances.

Uploaded by

Karthik S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Welcome to

SMSGATEWAYHUB
HTTP API Guide.

Introduction API 3.2


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’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

HTTP POST v/s HTTP GET

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.

Access Quick HTTP SMS API URL List

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.

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 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

Text :- Your sms content

160 characters 1 message


161 – 306 characters 2 messages
307 – 459 characters 3 messages
460 – 612 characters 4 messages
613 – 765 characters 5 messages
766 – 918 characters 6 messages
919 – 1071 characters 7 messages
1072 – 1224 characters 8 messages
1225 – 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.

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

Sending a Multiple Messaging (BULK Messaging)


For sending Bulk SMS messages, the following URL, along with the required parameters, needs to be accessed

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"
}
]
}

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.

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"}]}

Group SMS API

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"}]}

To Get All Group Details

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

To Add New Group

https://www.smsgatewayhub.com/api/group/addnewgroup?APIKey=yourapicode&GroupName=Name

Groupname – you want to create new group name

Response in XML:

{
"Status": true,
"Result": "Success:22358"
}

Note : In above api it will return either grouip or error on result

To Add Number’s in Group

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."
}

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
https://www.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

https://www.smsgatewayhub.com/smsapi/mis.aspx?user=username&password=password&fromdate=mm
/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

https://www.smsgatewayhub.com/api/mt/GetBalance?APIKey=yourapicode

Response in XML:

{"ErrorCode":"0","ErrorMessage":"Success","Balance":"Promo:0|Trans:0"}
Shortlink API

Post Method URL

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:

• Trigger API: https://www.smsgatewayhub.com/api/mt/SendSms

<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>

Add for schedule the campaign < SchedTime>schedule time</ SchedTime>

for group message < GroupId>group id</ GroupId>

• Response:

{
"ErrorCode": "000",
"ErrorMessage": "Success",
"JobId": "375887642",
"MessageData": [
{
"Number": "9198765XXXXX",
"MessageId": "KB9O7ys6BUKfpKUptuCfQQ",
"Message": "Hello world"
}
]
}

➢ Parameters details:

For yourapikey - https://www.smsgatewayhub.com/Panel/WebAPI/APICodes.aspx

Channel=2 for transactional, Channel=1 for promotional

DCS=0 For English, DCS=8 For Unicode (Hindi, Marathi, Punjabi etc.)

Route=1 (Default)

Sender ID - WEBSMS or Your approved sender ID as per DLT


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

For More Detail Please visit : https://www.smsgatewayhub.com/free-sms-gateway-developer-


api.aspx

Thank you

For any Kindly of Support in API Please Mail Us at : [email protected] or call :


9907922122 & Press 112

You might also like