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

api-document

The document is an End User Manual for an HTTP(S)/XML/JSON API module designed for sending SMS messages through an SMS Gateway. It outlines the necessary parameters for API requests, including compulsory and optional parameters, as well as examples for sending single and bulk messages in various formats. Additionally, it provides information on response formats, error codes, and delivery reports (DLR) retrieval methods.

Uploaded by

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

api-document

The document is an End User Manual for an HTTP(S)/XML/JSON API module designed for sending SMS messages through an SMS Gateway. It outlines the necessary parameters for API requests, including compulsory and optional parameters, as well as examples for sending single and bulk messages in various formats. Additionally, it provides information on response formats, error codes, and delivery reports (DLR) retrieval methods.

Uploaded by

Shinoj CP
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

End User Manual

For
HTTP(S)/XML/JSON API
Overview
HTTP(S)/XML/JSON API module is intended for users, who wants to use API SMS Gateway for
sending messages. You can send single/multiple SMS using HTTP/HTTPS API format and XML/JSON
API format. User name and Password for sending messages, will be provided by our Team after user
opens his account.
System Overview
HTTP/HTTPS API
HTTP/HTTPS API supports requirements given below.
1. Supports all languages with special characters
2. Supports concatenated messages (long SMS)
3. Supports text and Unicode messages (Hindi, Gujarati, Marathi etc)
4. Dynamic sender identity
URL:
You will call URL given below, using GET method.
http://web.smsgw.in/smsapi/httpapi.jsp?
OR
https://web.smsgw.in/smsapi/httpapi.jsp?
Please mention the below parameters for above URL request:
Compulsory Parameter Description
1. username: Valid User Name provided, when user registers for an account.
2. password: Valid Password provided in combination with the Username, when user registers
for an account.
3. to: comma separated mobile numbers on which message will be delivered. (Example
98XXXXXXXX).
4. from: from parameter refers to the Sender Id registered for sending messages
5. text: text parameter refers to the Message content, which needs to be sent to entered Mobile
Number. (Example: Written content will be sent.)
6. pe_id:entity id generated by registering on DLT Platform of operator
7. template_id- template id generated against approved sms content on DLT platform
Optional Parameter Description
1. coding: If you want to send Unicode SMS, then enter value as 2. If you do not use this
parameter, then it will take non-Unicode by default.
2. scheduletime: Schedule time to deliver this message in the format of YYYY-MM-DD HH:mm
3. flash: If you want to send Flash SMS, then enter value as per below requirement:
✓ 1 : This type supports all modern handsets and English SMS count will be as 70 chars per
SMS (like non –English SMS).
✓ 2 : This type might be not supports all modern handsets and English SMS count will be
as 160 chars per SMS (like other English SMS).
4. responsetype: you can get response in text by using ‘csv’ and in JSON by using ‘json’ as value in
this parameter. Default response type will be XML if you are not using this parameter.
Note: Note:we recommender sending sms content in url encoded format for
English sms and UTF16 for Unicode sms because if you are using special
characters in sms text then it may not be converted
Example to call HTTP(S)API
http://web.smsgw.in/smsapi/httpapi.jsp?username=XXXXXXXXXX&password=XXXXXX&from=XXXXXX
&t
o=XXXXXXXXXX,XXXXXXXXXX&text=hello+world&coding=0&pe_id=xxxxxx&template_id=xxxxx&sched
uletime=XXXX-XX-XX XX:XX&flash=1
OR
https://web.smsgw.in/smsapi/httpapi.jsp?username=XXXXXXXXXX&password=XXXXXX&from=XX
XXXX&
to=XXXXXXXXXX,XXXXXXXXXX&text=hello+world&coding=0&pe_id=xxxxxx&template_id=xxxxx
&scheduletime=XXXX-XX-XX XX:XX&flash=2
Response:
You will receive below XML response if Message is Successfully Sent.
<data>
<ackid>xxxxx-xxxxxxxxxx </ackid>
<msgid>xxxxxx-xxxxxxxxxxxx, xxxxxxxxxx</msgid>
</data>
You will receive below XML response if Message is not successfully sent.
<Error>
<ErrorCode>xxx</ErrorCode>
<ErrorDesc>xxxxxxxxxxxxxxxxx</ErrorDesc>
</Error>
XML API
For bulk SMS sending, write XML data in format given below and post to URL given.
XML Format for Single SMS to Multiple Numbers:
URL: You will call the below URL using POST method.
http://web.smsgw.in/mobxmlapi/xmlsmsapi.jsp
OR
https://web.smsgw.in/mobxmlapi/xmlsmsapi.jsp
<data>
<userinfo>
<name>XXXXXXXX</name>
<password>XXXXXXXX</password>
<from>XXXXXX</from>
<pe_id>xxxxxx</pe_id>
<template_id>xxxxxx</template_id>
</userinfo>
<recipient>
<to>XXXXXXXXXX</to>
</recipient>
<recipient>
<to>XXXXXXXXXX</to>
</recipient>
<recipient>
<to>XXXXXXXXXX</to>
</recipient>
</recipient>
<message>
<text>This is testing for xml data</text>
<coding>0</coding>
</message>
</data>
XML Format for Multiple SMS to Multiple Numbers:URL: You will call the below URL using POST
method.
http://web.smsgw.in/mtplxmlapi/xmlsmsapi.jsp
OR
https://web.smsgw.in/mtplxmlapi/xmlsmsapi.jsp
<data>
<userinfo>
<name>XXXXXXXX</name>
<password>XXXXXXXX</password>
<from>XXXXXX</from>
<pe_id>XXXXX</pe_id>
<template_id>xxxxxxx</template_id>
<coding>0</coding>
</userinfo>
<recipient>
<to>XXXXXXXXXX</to>
<msg>This is testing for xml data</msg>
</recipient>
<recipient>
<to>XXXXXXXXXX</to>
<msg>This is testing for xml data</msg>
</recipient>
<recipient>
<to>XXXXXXXXXX</to>
<msg>This is testing for xml data</msg>
</recipient>
<recipient>
<to>XXXXXXXXXX</to>
<msg>This is testing for xml data</msg>
</recipient>
<recipient>
<to>XXXXXXXXXX</to>
<msg>This is testing for xml data</msg>
</recipient>
<recipient>
<to>XXXXXXXXXX</to>
<msg>This is testing for xml data</msg>
</recipient>
</data>

XML Format for Single SMS to Multiple Numbers & Multiple SMS to Multiple Numbers:
URL: You will call the below URL using POST method.
http://web.smsgw.in/nxmlapi/xmlsmsapi.jsp
OR
https://web.smsgw.in/nxmlapi/xmlsmsapi.jsp
<data>
<user>
<name>XXXXXXXX</name>
<password>XXXXXXXX</password>
<from>XXXXXX</from>
<pe_id>xxxxxxx</pe_id>
<template_id>xxxxxx</template_id>
<to>XXXXXXXX</to>
<text> This is testing for xml data </text>
<coding>0</coding>
</user>
<user>
<name>XXXXXXXX</name>
<password>XXXXXXXX</password>
<from>XXXXXX</from>
<pe_id>xxxxxxx</pe_id>
<template_id>xxxxxx</template_id>
<to>XXXXXXXX</to>
<text> This is testing for xml data </text>
<coding>0</coding>
</user>
<user>
<name>XXXXXXXX</name>
<password>XXXXXXXX</password>
<from>XXXXXX</from>
<pe_id>xxxxxxx</pe_id>
<template_id>xxxxxx</template_id>
<to>XXXXXXXX</to>
<text> This is testing for xml data </text>
<coding>0</coding>
</user>
.
.
.
.
</user>
</data>
Compulsory Parameter Description
1. username: Valid User Name provided, when user registers for an account
2. password: Valid Password provided in combination with the Username, when user registers
for an account.
3. to: comma separated mobile numbers on which message will be delivered. (Example
98XXXXXXXX).
4. from: from parameter refers to the Sender Id registered for sending messages
5. text: text parameter refers to the Message content, which needs to be sent to entered Mobile
Number. (Example: Written content will be sent.)
6. pe_id:entity id generated by registering on DLT Platform of operator
7. template_id- template id generated against approved sms content on DLT platform
Optional Parameter Description
1. coding: If you want to send Unicode SMS, then enter value as 2. If you do not use this
parameter,then it will take non-Unicode by default.
Note:we recommender sending sms content in url encoded format for English
sms and UTF16 for Unicode sms because if you are using special characters in
sms text then it may not be converted
2.
Response:
You will receive below XML response if Message is successfully sent.
<data>
<ackid>xxxxx-xxxxxxxxxx </ackid>
<msgid>xxxxxx-xxxxxxxxxxxx, xxxxxxxxxx</msgid>
</data>
You will receive below XML response if Message is not successfully sent.
<Error>
<ErrorCode>xxx</ErrorCode>
<ErrorDesc>xxxxxxxxxxxxxxxxx</ErrorDesc>
</Error>

JSON API
For bulk SMS sending, write JSON data in format given below and post to URL given.
JSON Format for Single SMS to Single/Multiple Numbers:
URL: You will call the below URL using POST method.
http://web.smsgw.in/smsapi/jsonapi.jsp
OR
https://web.smsgw.in/smsapi/jsonapi.jsp
{
"username" : "XXXXXXXXX",
"password" : "XXXXXXXX",
"from" : "XXXXXX",
"pe_id": "xxxxxxx",
"template_id": "xxxxxx"
"to" : [ "XXXXXXXXXX","XXXXXXXXXX","XXXXXXXXXX","XXXXXXXXXX",.................... "XXXXXXXXXX" ],
"text" : "This is testing for json data",
"coding" : "0",
"flash" : "1",
“scheduletime” : "XXXX-XX-XX XX:XX"
}
Compulsory Parameter Description
1. username: Valid User Name provided, when user registers for an account
2. password: Valid Password provided in combination with the Username, when user registers
for an account.
3. to: comma separated mobile numbers on which message will be delivered. (Example
98XXXXXXXX).
4. from: from parameter refers to the Sender Id registered for sending messages
5. text: text parameter refers to the Message content, which needs to be sent to entered Mobile
Number. (Example: Written content will be sent.)
6. pe_id:entity id generated by registering on DLT Platform of operator
7. template_id- template id generated against approved sms content on DLT platform
Note:we recommender sending sms content in url encoded format for English sms
and UTF16 for Unicode sms because if you are using special characters in sms
text then it may not be converted

Optional Parameter Description


1. coding: If you want to send Unicode SMS, then enter value as 2. If you do not use this
parameter, then it will take non-Unicode by default.
2. scheduletime: Schedule time to deliver this message in the format of YYYY-MM-DD HH:mm
3. flash: If you want to send Flash SMS, then enter value as per below requirement:
✓ 1 : This type supports all modern handsets and English SMS count will be as 70 chars per
SMS (like non –English SMS).
✓ 2 : This type might be not supports all modern handsets and English SMS count will be
as 160 chars per SMS (like other English SMS).
Response:
You will receive below JSON response if Message is successfully sent.
{
“data” : {
“ackid” : “xxxxx-xxxxxxxxxx”,
“msgid” : [ “xxxxxx-xxxxxxxxxxxx, xxxxxxxxxx”, “xxxxxx-xxxxxxxxxxxx, xxxxxxxxxx”,............ ]
}
}
You will receive below JSON response if Message is not successfully sent.
{
“Error” : {
“ErrorCode” : “xxx”,
“ErrorDesc” : “xxxxxxxxxxxxxxxxx”
}
}

JSON API(Multiple to Multiple)


For bulk SMS sending, write JSON data in format given below and post to URL given.
JSON Format for Different SMS to Multiple Numbers:
URL: You will call the below URL using POST method.
http://web.smsgw.in/smsapi/jsonapi_mtpl.jsp
OR
https://web.smsgw.in/smsapi/jsonapi_mtpl.jsp
Data Format:
{
"username":"xxx",
"password":"xxx",
“from" : "xxxxxx",
"data": [
{"to":"xxxxxxxxxx", "text":"xxx xxxxxx xxxxx xxxx ","coding" : "0","pe_id":"xxxx","template_id":"xxxxx"},
{"to":"xxxxxxxxxx", "text":"xxxx xxxx xxxx","coding" : "0","pe_id":"xxxx","template_id":"xxxx"},
{"to":"xxxxxxxxxx", "text":"%xx%xx%xx%xx% ","coding" : "2"","pe_id":"xxxx","template_id":"xxxx"}
],

"flash" : "1",
"scheduletime" : "XXXX-XX-XX XX:XX"
}

Compulsory Parameter Description


1. username: Valid User Name provided, when user registers for an account
2. password: Valid Password provided in combination with the Username, when user registers
for an account.
3. mobile numbers and text as well as coding (coding= 0 for English message and coding=2 for Unicode
message.
4. from: from parameter refers to the Sender Id registered for sending messages
5. pe_id
Optional Parameter Description
1. scheduletime: Schedule time to deliver this message in the format of YYYY-MM-DD HH:mm
2. flash: If you want to send Flash SMS, then enter value as per below requirement:
✓ 1 : This type supports all modern handsets and English SMS count will be as 70 chars per
SMS (like non –English SMS).
✓ 2 : This type might be not supports all modern handsets and English SMS count will be
as 160 chars per SMS (like other English SMS).
✓ Note:we recommender sending sms content in url encoded format for English sms
and UTF16 for Unicode sms because if you are using special characters in sms
text then it may not be converted

Response:
You will receive below JSON response if Message is successfully sent.

{
"report":{
"msgid":"xxxxx-xxxxxxxx,msisdn","ackid":"xxxxxxxxx"
}
}
{"report":{
"msgid":"xxxxxx-xxxxxxxx,msisdn","ackid":"xxxxxxxxx"
}
}
…………………………
…………………………
{"report":{
"msgid":"xxxxxx-xxxxxxxx,msisdn","ackid":"xxxxxxxxx"
}
}
Error Response:
You will receive below JSON response if Message is not successfully sent.
{
“Error” : {
“ErrorCode” : “xxx”,
“ErrorDesc” : “xxxxxxxxxxxxxxxxx”
}
}
Pull DLR API
URL for getting delivery report:
http://web.smsgw.in/dlrresponse/dlrresp.jsp?ackid=xxxx
xx OR
https://web.smsgw.in/dlrresponse/dlrresp.jsp?ackid=xxxxxx
Parameter Description:
1. ackid: ackid is the parameter, for which you want DLR and this should be same as you have got in
response for requested SMS through HTTP/XML API.
2. responsetype: you can get response in text by using ‘csv’ and in JSON by using ‘json’ as value in
this parameter. Default response type will be XML if you are not using this parameter.
Response:
You will receive below XML response.
<dlr>
<dlrinfo>
<msgid>xxxxx-xxxxxxxxxxx</msgid>
<ackid>xxxx-xxxxxxxxxxxxx</ackid>
<mob>91xxxxxxxxxx</mob>
<senderid>xxxxxx</senderid>
<submittime>xxxx-xx-xx xx:xx:xx.x</submittime>
<delvtime> xxxx-xx-xx xx:xx:xx.x </delvtime>
<dlrdesc>xxxxxxxxxxxxx</dlrdesc>
</dlrinfo>
<dlrinfo>
<msgid> xxxxx-xxxxxxxxxxx </msgid>
<ackid> xxxxxxxxxxxxxxxxxx </ackid>
<mob>91xxxxxxxxxx</mob>
<senderid>xxxxxx</senderid>
<submittime> xxxx-xx-xx xx:xx:xx.x </submittime>
<delvtime> xxxx-xx-xx xx:xx:xx.x </delvtime>
<dlrdesc>xxxxxxxxxxxxxx </dlrdesc>
</dlrinfo>
</dlr>
Push DLR
Client’s URL need to be configured at our end in order to push the DLR with below Parameters:
message_id (For Exp: username-1484380575027)
dlrstatus (For Exp:
Delivered) msisdn (For
Exp: 9266669268)
sender_id (For Exp:
TESTIN)
submittime (For Exp: 2017-04-14 13:26:00)
delvtime (For Exp: 2017-04-14 13:27:00)
dlrcode (For Exp: 000)
Client will receive above parameters on their configured URL.
Error Codes with Description
Code
Descrip
tion
010 Sender Id length/format
error011 MSISDN
Length/Format Error 15
Insufficient Credit Error
103 Message Empty
Error104 Coding
Error
105 Scheduletime Format Error
**NOTE: MESSAGE HAS TO BE URL ENCODED FORMAT
**NOTE: MULTIPLE MOBILE NUMBERS HAS TO BE COMMA SEPERATED
For any support, please contact our Team
****************************End of Document*******************************

You might also like