Spring Edge: HTTP API Documentation (Transactional SMS)
Spring Edge: HTTP API Documentation (Transactional SMS)
This User Manual provides specifications of the HTTP based API provided by SpringEdge for the
automated sending of SMS via the Internet. This guide is intended for developers and clients
alike who plan to integrate their systems with SpringEdgesMessaging service.
Required Environment
In order to use the HTTP based API, you will need to have a system that has internet connectivity.
This connectivity may be direct to the internet or via a firewall or proxy server.
Additionally, should you wish to receive delivery reports (DLRs) from the SpringEdge system, you must have
a web server that is able to receive incoming requests from the Internet. This web server does not
necessarily have to be running on the same machine that is sending messages to SpringEdge.
This is one of the simpler server-based forms of communication. It can be used either in the form of
a HTTP POST or HTTP GET. We recommend POST for larger data transfer and data security. All calls to
the API must be URL-encoded. The parameter names are case sensitive.
HTTP Methods
HTTP POST or GET method is used in HTTP API for following things:
1. To send text messages: Your message and destination mobile numbers are sent to us. The
message is then delivered to the destination mobile number by our system.
2. To receive delivery notifications: A notification with all required details are sent to a URL
predetermined by you.
3. To check the message delivery status: The message delivery status is sent to you when you
provide us with the unique message ID.
4. To check the available credits: you can check the available credits in your account.
Note: We recommend POST for larger data transfer and data security. All calls to the
APImust be URL encoded.
Page | 3
Security
HTTP API supports both HTTP and HTTPS. Using HTTPS to encrypt all requests through SSL is
recommended, but if you're using a client and tool that's not set up to make SSL requests, you can
use HTTP. All requests are secured through BASIC authentication via the Working Key. An additional
level of protection is provided where Working key can be configured to accept requests from a
specific IP Address only.
Request Limitations
Maximum of 10 requests per second is allowed per IP address. Crossing the limitation by Sending
huge requests from same IP Address (using unconditional loop) is prohibited. This could get your IP
Address blocked temporarily. We recommend to use XML API instead using which different messages
can be sent to different mobile numbers using single request.
Output Restrictions
If the provider network is down, our Gateway Servers will retry your message up to six hours
before giving up.
Duplicate messages in single request are NOT filtered by default. A "duplicate message" is defined
as the same destination address, sender address and message body.
Page | 4
Unicode
When using non-GSM 03.38 characters SMS transmits as a Unicode message. The Unicode
character support provides the ability to send a message in Hindi, Kannada, Tamil etc.
1
2
Number of SMS
Unicode Characters
Using Unicode, for such languages as Hindi, restricts your message to a maximum of 70 characters per
SMS. You can, however, send longer text messages, with our system splitting them into two or at the
three separate text messages. The maximum lengths of two-part and three-part multipart Unicode
text messages are 134 (2 x 67) and 201 (3 x 67) characters, respectively. You could send up to 500
characters as multipart message which will be split into 8 messages internally.
Number of SMS
1
2
Page | 5
Sender ID Options
All text messages carry a sender ID. When you send a text message through HTTP API, you could use
any of the approved sender IDs for your account. You can reach us for applying for a new sender ID.
Page | 6
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
NAME
URL
PARAMETER
SMS_Service_URL
API Key
Apikey
Sender ID
sender
Mobile Number
to
Message
message
DESCRIPTION
URL of your SMS
Service
API key generated
from your SMS
Account
REQUIRED VALUE
URL
Sender ID
assigned to your
account
Mobile number to
which the SMS is
to be sent
Sender ID
Message to be
sent
Message text
which is URL
encoded
API Key
Mobile Number
Optional Parameters
The optional parameters in the HTTP API are tabulated below:
NAME
Format
PARAMETER
format
DESCRIPTION
Output format
should be as
specified by this
variable
REQUIRED VALUE
XML/JSON
Page | 7
Response Formats
By default, the HTTP API URL generates responses in plain text format. You can also generate
responses in JSON and XML formats using the API URL. All you need to do is add &text=json (for
JSON format) or &text=xml (for XML format) at the end of the HTTP API URL.
JSON Format
For example, to receive the response in JSON format, the URL should be of the following format.
http://<SMS_Service_URL>/api/web/send?apikey= XXXXXXXXXXXXXXXXX
&sender=XXXXXX&to=9900xxxxxx&message=TEST&format=json
{"groupID":61,"MessageIDs":"61-1","status":"AWAITED-DLR"}
XML Format
To receive the response in XML format, the URL should be of the following format.
http://<SMS_Service_URL>/api/web/send?apikey= XXXXXXXXXXXXXXXXX
&sender=XXXXXX&to=9900xxxxxx&message=TEST&format=xml
The response in XML format will be as shown below
<xml>
<groupID>62</groupID>
<MessageIDs>62-1</MessageIDs>
<status>AWAITED-DLR</status>
</xml>
Page | 8
Error Codes
When certain parameters of the HTTP API URL are not entered correctly, you will receive a
response from the URL stating the type of error. These error codes will help you to pin-point the
erroneous parameter in the URL and rectify it.
The common error codes received while using the HTTP API are tabulated below:
URL RESPONSE/ERROR CODE
Invalid Input Data
Account Inactive. Please contact Support
DESCRIPTION
One of the values are missing.
Your SMS account is inactive/deactivated.
Invalid Sender ID
Insufficient Credits
Invalid Message GID
Sending an SMS
HTTP API sends a text message using POST/GET and form-encoded data. The URL you use to send a
text message has a required field called working key, which is unique and assigned to your account.
The three required parameters for the Request are sender, to and message, which are used to define
the destination phone number and the message body. If you want to send to multiple phone numbers,
provide the numbers in comma separated format.
Page | 9
To send an SMS using the HTTP API, the following URL format is used:
http://<SMS_Service_URL>/api/web/send?apikey=<API_KEY>&to=<MOBILENUMBER>&s
ender=<SENDERID>&message=<MESSAGE>
FIELD NAME
<API_KEY>
<MOBILENUMBER>
<SENDERID>
<MESSAGE>
DESCRIPTION
API key generated from SMS account.
The destination mobile number can be with or
without +91 and 91.
Approved Sender ID
The text message that needs to be sent. The
message should be URL encoded.
For example;
http://<SMS_Service_URL>/api/web/send?apikey=<API_KEY>&to=9900XXXXXX&sender=
DEMO&message=THISIS A TEST SMS
The URL shown above will send an SMS from your account to the mobile number 9900XXXXXX
with the Sender ID as DEMO and the text THIS IS A TEST SMS.
Method:
POST / GET
Request:
apikey=XXXXXXXXXXXXXXXXX&to=9900XXXXXX&sender=XXXXXX&message=hello
Response Formats:
The HTTP API response in the various supported formats are given below.
Text Response:
Message GID=360 ID=360-1
Invalid/DND Numbers:1
JSON Response:
{"groupID":61,"MessageIDs":"61-1","status":"AWAITED-DLR"}
Page | 10
XML Response:
<xml>
<groupID>62</groupID>
<MessageIDs>62-1</MessageIDs>
<status>AWAITED-DLR</status>
</xml>
DESCRIPTION
One of the values are missing.
The mobile number entered is invalid/less that
10 digits
Insufficient Credits
Message GID=<GROUPID>
ID
Note: The SMS you send can contain a maximum of 1000 characters. The
creditsfor each SMS will be charged according to the length of each SMS.
Page | 11
FIELD NAME
<API_KEY>
<MESSAGEID>
DESCRIPTION
API key generated from SMS account.
The Message ID that was previously display when
submittingSMS.
For example;
http://<SMS_Service_URL>/api/status/message?apikey=<API_KEY>&messageid=123XXX
The URL shown above will display the delivery status of the SMS with the corresponding Message ID.
The common statuses displayed are SUBMITTED, DELIVRD, UNDELIVRD, REJECTED etc.
Response Formats:
The HTTP API response in the various supported formats are given below.
JSON Response:
{"id":"363-1","Recipient":"+919900xxxxxx","status":"AWAITED-DLR"}
XML Response:
<xml>
<id>36-1</id>
<Recipient>+919900xxxxxx</Recipient><
status>AWAITED-DLR</status>
</xml>
DESCRIPTION
One of the values are missing
Your SMS account is inactive/deactivated.
The Message ID does not exist
Display the status of the SMS such as
SUBMITTED, DELIVRD, UNDELIVRD, REJECTED
Page | 12
FIELD NAME
<API_KEY>
<MESSAGEGID>
DESCRIPTION
API key generated from SMS account
The message Group ID previously displayed when
submitting SMS.
For example;
http://<SMS_Service_URL>/status/group?apikey=<API_KEY>&messagegid=123XXX
The URL shown above will retrieve the group SMS status of the corresponding Message
IDs. The common responses are MESSAGEGID, DESTINATION NUMBER, SUBMITTED
Response Formats:
The HTTP API responses in the various supported formats are given below.
JSON Response:
[{"ID":"363-1","Recipient":"+919900xxxxxx","StatusDetails":"AWAITEDDLR","UpdatedTime":"2013-06-17 14;40:59"}]
XML Response:
<xml>
<sms><ID>363-1</ID>
<Recipient>+919900xxxxxx</Recipient>
<StatusDetails>AWAITED-DLR</StatusDetails>
<UpdatedTime>2013-06-17 14;40:59</UpdatedTime>
</sms>
</xml>
Page | 13
DESCRIPTION
One of the values are missing
Your SMS account is inactive/deactivated.
Invalid Message GID
Display the status of the SMS such as
SUBMITTED, DELIVRD, UNDELIVRD, REJECTED
DESCRIPTION
API key generated from SMS account.
For example;
http://<SMS_Service_URL>/api/status/credit?apikey=<API_KEY>
The preceding URL will fetch and display the number of credits available in your SMS account.
DESCRIPTION
The value on the URL is missing
Your SMS account is inactive/deactivated.
Display the available credits in your account
The HTTP API responses in the various supported formats are given below.
JSON Response:
{"Credits":"28028585"}
XML Response:
<xml>
</xml>
<Credits>28028585</Credits>
Page | 14
Invalid Sender ID
DESCRIPTION
One of the values are missing
Your SMS account is inactive/deactivated.
The mobile number entered is invalid/less than
10 digits.
The Sender ID type on the url is either no applied
for or has not been approved
Insufficient Credits
Invalid Schedule Date and Time!
RESPONSE
Schedule time already past!
DESCRIPTION
Time specified has already passed
Message GID=<GROUPID>
ID=<MESSAGEID>,<MESSAGEID2>
FIELD NAME
<API_KEY>
<MOBILENUMBER>
DESCRIPTION
API key generated from sms account.
The destination mobile number can be with or
without +91 and 91.
<SENDERID>
<MESSAGE>
Approved Sender ID
The text message that needs to be sent. The
message text should be in language you need to
sendsms.
UNICODE=<1>
For example;
http://<SMS_Service_URL>/api/web/send?apikey=<API_KEY>&to=9900XXXXXX&sender=DEMO&message=xx
xxxxxx&unicode=1
The preceding URL will send a Unicode SMS from your SMS account to the mobile
number 9900XXXXXX with the sender ID as DEMO with the message textxxxxxxxxx.
Response Formats:
The HTTP API responses in the supported formats are given below.
Text Response:
Message GID=258 ID=258-1 Invalid/DND Numbers:
JSON Response:
{"groupID":384,"messages":[{"id":"258-1","mobile":"9900xxxxxx","status":"AWAITED_DLR"}]}
XML Response:
<xml>
<groupID>258</groupID>
<messages><sms><id>258-1</id>
<mobile>9900xxxxxx</mobile>
<status>AWAITED_DLR</status></sms></messages>
</xml>