API Documentation Download

Press on PDF image for download

S.NOContent
1Introduction
2SMPP
3HTTP
3.1Message Submission & Scheduling
3.2Status Enquiry
3.3Balance Enquiry
3.4Coverage Download
3.5Web DLR
3.6DlrReport(XLSX)
3.7Remove Schedule
4JSON
5XML
6Status Code

1-Introduction

This document provides SMPP specification including connection to advance messaging systems server, bind options and specification for sending sms over SMPP. This document also provides HTTP API used to sending SMS, collecting delivery reports along with HTTP API specification.

2-SMPP

The Short Message Peer-to-Peer (SMPP) is a protocol used by the telecommunications industry for exchanging SMS messages between Short Message Service Centers (SMSC) and External Short Messaging Entities (ESME). The protocol is a level-7 TCP/IP protocol, which allows fast delivery of SMS messages.

The connection between application and AMS SMPP Server is SMPP version 3.4

BIND Operation: The purpose of the SMPP bind operation is to register an instance of an ESME with the SMSC system and request an SMPP session over this network connection for the submission or delivery of messages. Thus, the Bind operation may be viewed as a form of SMSC login request to authenticate the ESME entity wishing to establish a connection.

BIND Mode: User may bind as either Tx (Transmitter), Rx (Receiver) or TRx (Transceiver).

Tx: User bound as a Transmitter is authorized to send short messages and to receive the corresponding SMPP responses.

Rx: User bound as a Receiver is authorized to receive short messages and to return the corresponding SMPP message responses.

TRx: User bound as a Transceiver is allowed to send & receive messages over a single SMPP session.

*Users are allowed to bound as only 1 TRx/Rx with multiple Tx Session.

Request Parameters:

NameDescription
System idProvided System Id
PasswordProvided Password
IP37.216.206.85
Port8899
System typeNull

SMPP Status Codes:

NameValueDescription
ESME_ROK0x00000000No Error
ESME_RINVMSGLEN0x00000001Invalid Message Length
ESME_RINVCMDLEN0x00000002Invalid Command length
ESME_RINVCMDID0x00000003Invalid/Unsupported Command ID
ESME_RINVBNDSTS0x00000004Incorrect bind status
ESME_RALYBND0x00000005Already bound
ESME_RINVPRTFLG0x00000006Invalid Priority Flag
ESME_RINVREGDLVFLG0x00000007Invalid Registered Delivery Flag
ESME_RSYSERR0x00000008System Error
ESME_RINVSRCADR0x0000000AInvalid source address
ESME_RINVDSTADR0x0000000BInvalid destination address
ESME_RINVMSGID0x0000000CMessage ID is invalid
ESME_RBINDFAIL0x0000000DBind failed
ESME_RINVPASWD0x0000000EInvalid password
ESME_RINVSYSID0x0000000FInvalid System ID
ESME_RCOVERR0x00000012No Coverage For Requested Destination
ESME_RREPLACEFAIL0x00000013Message replacement failed
ESME_RMSGQFUL0x00000014Message queue full
ESME_RINVSERTYP0x00000015Invalid service type
ESME_RINVADR0x00000022Invalid Address
ESME_RPARAMRETFAIL0x00000031Parameter Retrieve Failed
ESME_RINVPARAM0x00000032Invalid Parameter
ESME_RINVNUMDESTS0x00000033Invalid number of destinations
ESME_RINVDESTFLAG0x00000040Invalid destination flag
ESME_RINVBALANCE0x0000040BInsufficient Balance
ESME_RINVSUBREP0x00000042Invalid Submit Replace
ESME_RINVESMCLASS0x00000043Invalid ESM class
ESME_RCNTSUBDL0x00000044Cannot Submit to Distribution List
ESME_RSUBMITFAIL0x00000045Failed To Submit
ESME_RINVSRCTON0x00000048Invalid Source Address TON
ESME_RINVSRCNPI0x00000049Invalid Source Address NPI
ESME_RINVDSTTON0x00000050Invalid Destination Address TON
ESME_RINVDSTNPI0x00000051Invalid Destination Address NPI
ESME_RINVSYSTYP0x00000053Invalid system type
ESME_RINVREPFLAG0x00000054Invalid replace_if_present flag
ESME_RINVNUMMSGS0x00000055Invalid number of messages
ESME_RTHROTTLED0x00000058Throttling error
ESME_RPROVNOTALLWD0x00000059Provisioning Not Allowed
ESME_RINVSCHED0x00000061Invalid scheduled delivery time
ESME_RINVEXPIRY0x00000062Invalid Validity Period value
ESME_RX_T_APPN0x00000064ESME Receiver temporary error
ESME_RX_P_APPN0x00000065ESME Receiver permanent error
ESME_RX_R_APPN0x00000066ESME Receiver reject message error
ESME_RQUERYFAIL0x00000067Message query request failed
ESME_RINVMDTLEN0x0000008DMessage delivery time Length Invalid
ESME_RINVREGDELLEN0x00000093Registered Delivery Lenght Invalid
ESME_RINVREGDEL0x0000009CRegistered Delivery Invalid
ESME_RUNKNOWNERR0x000000FFUnknown error
ESME_LAST_ERROR0x0000012CLast error code

3-HTTP

The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. This is the foundation for data communication for the World Wide Web (i.e. internet)

HTTP is a generic and stateless protocol which can be used for other purposes as well using extensions of its request methods, error codes, and headers. This document provides developers with instructions for integrating SMS messaging services into various solutions using HTTP API.>

This HTTP API can be used in sending SMS, collecting delivery reports along with HTTP API specification .This document also provide SMPP specification including connection to advance messaging systems server, bind options and specification for sending sms over SMPP

Users can Use Following Services via HTTP API:

  • Message Submission & Scheduling
  • Status Enquiry
  • Balance Enquiry
  • Coverage Download

3.1-Message Submission & Scheduling

HTTP API supports both GET and POST Methods. Using GET Method limit of up to 100 numbers is allowed in a single request. For POST Method limit of up to 10000 numbers is allowed in a single request.

Description:

URL for Message Submission:

https://tawasolsms.com:8582/websmpp/websms? user=xxxx&pass=xx&sid=xxxxx&mno=966xxxxx&type=x&text=xxx

or

https://tawasolsms.com:8582/websmpp/websms? accesskey=xxxxxxxxxxxxxxx &sid=xxxxx&mno=966xxxxx&type=x&text=xxx

If Response Required in JSON Format:

https://tawasolsms.com:8582/websmpp/websms? user=xxxx&pass=xx&sid=xxxxx&mno=966xxxxx&type=x&text=xxx&respformat=json

URL for Message Scheduling:

https://tawasolsms.com:8582/websmpp/websms? user=xxxx&pass=xx&sid=xxxxx&mno=966xxxxx&type=x&text=xxx &gmt=xxxxx&schtime=xxxxxxxxxxxx

Using configured group of address book:

https://tawasolsms.com:8582/websmpp/websms/groupsms? user=xxxx&pass=xx&sid=xxxxx&group=GR1&limit=100&type=x&text=xxx

Requested Parameters (mandatory):

NameDescription
userProvided System Id
passProvided Password
accesskeyCan be used instead of user & pass
sidSource Number (Numeric/Alphanumric)
mno/groupDestination Number/Group or Comma separated Destination Numbers (Including Country Code)/Groups
typeMessage Type (1,2,3,4)
textMessage Content

Optional Parameters (Scheduling):

NameDescription
gmtGMT i.e. +0530
schtimeSchedule time (yyyyMMddhhmm)
limitDestination number limit per group
respScheduleId Required (true/false)

Optional Parameters (others):

NameValueDescription
respformatjsonIf response required in json format

Message Type & Length:

NameMessage TypeLength (1 SMS)
1English160
2Unicode280
3Special Character160
4Arabic70

 

Examples:

 

  • English Message:

https://tawasolsms.com:8582/websmpp/websms? user=testUser&pass=12345&sid=Test&mno=966xxxxx&type=1 &text=testing English message

  • Unicode Message:

https://tawasolsms.com:8582/websmpp/websms? user=testUser&pass=12345&sid=Test&mno=966xxxxx&type=2 &text= 00740065007300740069006E006700200075006E006 90063006F006400650020006D006500730073006100670065

  • Special Character Message:

https://tawasolsms.com:8582/websmpp/websms? user=testUser&pass=12345&sid=Test&mno=966xxxxx&type=3 &text=testing $@ Character

  • Arabic:

https://tawasolsms.com:8582/websmpp/websms? user=testUser&pass=12345&sid=Test&mno=966xxxxx&type=4 &text= اختبار رسالة عرب

  • Scheduling:

https://tawasolsms.com:8582/websmpp/websms? user=testUser&pass=12345&sid=Test&mno=966xxxxx&type=1 &text=testing Schedule &gmt=+0530&schtime=201605101422&resp=true

Note: The characters [ ] { } | \ ~ ^ will be counted twice. The characters & and # are restricted in message content.

Response Format

On Successful Submission (Default Format):

Response: 1507211343399277335

On Successful Submission (JSON Format):

{"Response":["1912181513205684021"]}

On Successful Scheduling (resp=false):

Response: Total Message Scheduled -> 2

On Successful Scheduling (resp=true):

Response: ScheduleId: 2106221027444687393

On Failed (Possible Errors):

ERROR - HTTP01 --> Invalid HTTP URL Format

ERROR - HTTP02 --> Invalid query string

ERROR - HTTP03 --> Message Submission Failed

ERROR - HTTP04 --> Invalid Password

ERROR - HTTP05 --> Invalid System ID

ERROR - HTTP06 --> Invalid Sender ID

ERROR - HTTP07 --> Invalid Type

ERROR - HTTP08 --> Invalid Message ID

ERROR - HTTP09 --> Invalid Destination Address

ERROR - HTTP10 --> Invalid number of messages

ERROR - HTTP11 --> Requested service is unavailable

ERROR - HTTP12 --> Submit Failed

ERROR - HTTP13 --> Query request failed

ERROR - HTTP14 --> Bind failed

ERROR - HTTP15 --> Not Authorized for the request.

ERROR - HTTP16 --> Invalid Request

ERROR - HTTP17 --> Invalid Message Length

ERROR - HTTP18 --> INSUFFICIENT CREDITS/BALANCE

ERROR - HTTP19 --> Invalid DATA CODING SCHEME

ERROR - HTTP20 --> Invalid ESM

ERROR - HTTP21 --> Invalid HEADER

ERROR - HTTP22 --> Invalid Schedule Time

ERROR - HTTP23 --> Routing Error

ERROR - HTTP24 --> Exceeded number of Destination

ERROR - HTTP25 --> No Record Found

ERROR - HTTP26 --> Account Expired

3.2-Status Enquiry

After Successful Submission, User can get Message Status via Following URL:

https://tawasolsms.com:8582/websmpp/websmsstatus?respid=2541524

Resulting status would be one of them from the following table:

ATESPending
DELIVRDDelivered
UNDELIVUndelivered
EXPIREDMessage Validity Period Expired
REJECTDRejected
ACCEPTDAccepted
DELETEDDeleted
UNKNOWNUnknown

3.3-Balance Enquiry

After Successful Submission, User can get Message Status via Following URL:

https://tawasolsms.com:8582/websmpp/balanceReport?userid=systemid&password=pwd

or

https://tawasolsms.com:8582/websmpp/balanceReport?accesskey=xxxxxxxxxxxxxxx

  • The parameters userid & password are mandatory. Failing any would result in a negative response.

3.4-Coverage Download

User can get Coverage via Following URL:

https://tawasolsms.com:8582/websmpp/downloadcoverage? userid=systemid&password=pwd&format=x

or

https://tawasolsms.com:8582/websmpp/downloadcoverage? accesskey=xxxxxxxxxxxxxxx&format=x

Format is optional parameter. If not specified the default format will be 1.

Requested Formats:

ValueValue Downloaded Format
1XLS
2PDF
3CSV

3.5-Web DLR

User can get DLR via Provided Web Link. The URL for each client would look like ‘http://www.test.com/dlr/dlr.aspx’.The method used for posting delivery report onto the client’s URL is POST. After receiving DLR, the link must return Ok as acknowledgement.

The parameters appended to the URL would be as below:

ParameterDescription
MessageIdMessage Id provided on submission
SourceSource Address
DestinationDestination Number
StatusStatus of the Request (i.e. DELIVRD,UNDELIV,ATES)
SubmitDateTime of Submission (yyMMddHHmm)
DoneDateTime of Delivery Report Receiving( yyMMddHHmm )
BatchIdBatch Id As Immediate Response (for XML & JSON)

3.6-DlrReport (XLSX)

DLR Report in XLSX format can be downloaded via below Web Link:

https://tawasolsms.com:8582/websmpp/api/dlrreport?username=xxxx&pass=xxxx&from_date=20210821124545&to_date=20210821164545&is_content=1&sender=XYZ

or

https://tawasolsms.com:8582/websmpp/api/dlrreport?accesskey=xxxxxxxxxxxxxxx &from_date=20210821124545&to_date=20210821164545&is_content=1&sender=XYZ

Requested Parameters (mandatory):

NameDescription
usernameProvided Password
from_dateStart Date (yyyyMMddHHmmss)
to_dateEnd Date (yyyyMMddHHmmss)

Requested Parameters (Optional):

NameDescription
senderSource Address(Numeric/Alphanumeric)
Is_contentDefault value is 0.Values can be 0 or 1. If content is needed value must be 1

3.7-Remove Schedule

User can remove Scheduled Batch via Following URL:

https://tawasolsms.com:8582/websmpp/removeschedule?userid=testUser&password=xxx&scheduleid=2106221027211155451

4-JSON

Users can Use Following Services via JSON API:

  • Message Submission
  • Status Enquiry
4.1 Message Submission: The URL used to post XML formatted data is:

https://tawasolsms.com:8582/websmpp/json/sms

Request Format Example[1]:


                                                        {
                                                            "campaign": {
                                                                "username": "testUser",
                                                                "password": "xx",
                                                                "format": "1",
                                                                "sender": "JSON-1",
                                                                "gsm": [
                                                                    "919826321321",
                                                                    "919589321322"
                                                                ],
                                                                "text": "testing normal json api",
                                                                "type": "1"
                                                            }
                                                        }
                                                    

or


                                                        {
                                                            "campaign": {
                                                                "accesskey": "xxxxxxxxxxxxxxx",
                                                                "format": "1",
                                                                "sender": "JSON-1",
                                                                "gsm": [
                                                                    "919826321321",
                                                                    "919589321322"
                                                                ],
                                                                "text": "testing normal json api",
                                                                "type": "1"
                                                            }
                                                        }
                                                    

or (using configured group of address book)


                                                        {
                                                            "campaign": {
                                                                "username": "testUser",
                                                                "password": "xx",
                                                                "format": "1",
                                                                "sender": "JSON-1",
                                                                "group": [
                                                                    "GR1",
                                                                    "GR2"
                                                                ],
                                                                "limit": "100",
                                                                "text": "testing normal json api",
                                                                "type": "1"
                                                            }
                                                        }
                                                    

Request Format Example[2]:


                                                        {
                                                            "campaign": {
                                                                "username": "testUser",
                                                                "password": "xx",
                                                                "format": "2",
                                                                "type": "1",
                                                                "sender": "JSON-2",
                                                                "custom": [
                                                                    {
                                                                        "gsm": "919826321321",
                                                                        "text": "testing message 1"
                                                                    },
                                                                    {
                                                                        "gsm": "919589321322",
                                                                        "text": "testing message 2"
                                                                    }
                                                                ]
                                                            }
                                                        }
                                                    

Response: After Submission User will get Response as below:


                                                        {
                                                            "response": {
                                                                "batch_id": "0302201404163965268",
                                                                "status": "000"
                                                            }
                                                        }
                                                    

batch_id is unique id and used to identify all the messages( on all gsm numbers) associated with this request.

Status will be 000 on successful Submission. For Other status please check the status Code table.

4.2 Status Enquiry: After Successful Submission, User can get Message Status via Following URL:

https://tawasolsms.com:8582/websmpp/json/status

To Enquire the Status of Submissions, A specified format is Required as below:


                                                        {
                                                            "enquiry": {
                                                                "password": "xx",
                                                                "batch_id": "0302201420337911363",
                                                                "username": "testUser"
                                                            }
                                                        }
                                                    

or


                                                        {
                                                            "enquiry": {
                                                                "accesskey": "xxxxxxxxxxxxxxx",
                                                                "batch_id": "0302201420337911363"
                                                            }
                                                        }
                                                    

Resulted Format: The Resulted JSON Format Will be as below:


                                                        {
                                                            "result": {
                                                                "batch_id": "0302201420337911363",
                                                                "report": [
                                                                    {
                                                                        "request_status": "000",
                                                                        "dlr_status": "UNDELIV",
                                                                        "messageid": "2002031420338711051",
                                                                        "msisdn": "919826321321"
                                                                    },
                                                                    {
                                                                        "request_status": "000",
                                                                        "dlr_status": "DELIVRD",
                                                                        "messageid": "2002031420338811061",
                                                                        "msisdn": "919589321322"
                                                                    }
                                                                ]
                                                            }
                                                        }
                                                    

5-XML

Users can Use Following Services via XML API:

  • Message Submission
  • Status Enquiry
5.1 Message Submission: The URL used to post XML formatted data is:

https://tawasolsms.com:8582/websmpp/xmlsms

Request Format Example[1]:


                                                        <?xml version="1.0" encoding="UTF-8"?>
                                                        <campaign format="1">
                                                            <SMS>
                                                                <username>testUser</username>
                                                                <password>pass</password>
                                                                <type>1</type>
                                                                <sender>TEST-XML1</sender>
                                                                <text>testing xml request via http</text>
                                                                <recipients>
                                                                    <gsm>961231213</gsm>
                                                                    <gsm>961321987</gsm>
                                                                </recipients>
                                                            </SMS>
                                                        </campaign>
                                                    

or


                                                        <?xml version="1.0" encoding="UTF-8"?>
                                                        <campaign format="1">
                                                            <SMS>
                                                                <accesskey>xxxxxxxxxxxxxxx</accesskey>
                                                                <type>1</type>
                                                                <sender>TEST-XML1</sender>
                                                                <text>testing xml request via http</text>
                                                                <recipients>
                                                                    <gsm>961231213</gsm>
                                                                    <gsm>961321987</gsm>
                                                                </recipients>
                                                            </SMS>
                                                        </campaign>
                                                    

or (using configured group of address book)


                                                        <?xml version="1.0" encoding="UTF-8"?>
                                                        <campaign format="1">
                                                            <SMS>
                                                                <username>testUser</username>
                                                                <password>pass</password>
                                                                <type>1</type>
                                                                <sender>TEST-XML1</sender>
                                                                <text>testing xml request via http</text>
                                                                <recipients>
                                                                    <group>GR1</group>
                                                                    <group>GR2</group>
                                                                </recipients>
                                                                <limit>100</limit>
                                                            </SMS>
                                                        </campaign>
                                                    

Request Format Example[2]:


                                                        <?xml version="1.0" encoding="UTF-8"?>
                                                        <campaign>
                                                            <SMS format="2">
                                                                <username>testUser</username>
                                                                <password>pass</password>
                                                                <type>1</type>
                                                                <sender>TEST-XML1</sender>
                                                                <custom>
                                                                    <gsm>961231211</gsm>
                                                                    <text>testing xml custom request 1 via http</text>
                                                                </custom>
                                                                <custom>
                                                                    <gsm>961231212</gsm>
                                                                    <text>testing xml custom request 2 via http</text>
                                                                </custom>
                                                                <custom>
                                                                    <gsm>961231213</gsm>
                                                                    <text>testing xml custom request 3 via http</text>
                                                                </custom>
                                                            </SMS>
                                                        </campaign>
                                                    

Response:After Submission User will get Response as below:


                                                        <?xml version="1.0" encoding="UTF-8"?>
                                                        <response>
                                                            <status>000</status>
                                                            <batch_id>171117172801751</batch_id>
                                                        </response>
                                                    

batch_id is unique id and used to identify all the messages( on all gsm numbers) associated with this request. Status will be 000 on successful Submission. For Other status please check the xml status Code table.

5.2 Status Enquiry: After Successful Submission, User can get Message Status via Following URL:

https://tawasolsms.com:8582/websmpp/xmlstatus

To Enquire the Status of Submissions, A specified format is Required as below:


                                                        <?xml version="1.0" encoding="UTF-8"?>
                                                        <enquiry>
                                                            <username>testUser</username>
                                                            <password>pass</password>
                                                            <batch_id>171117104025321</batch_id>
                                                        </enquiry>
                                                    

or


                                                        <?xml version="1.0" encoding="UTF-8"?>
                                                        <enquiry>
                                                            <accesskey>xxxxxxxxxxxxxxx</accesskey>
                                                            <batch_id>171117104025321</batch_id>
                                                        </enquiry>
                                                      

Resulted Format: The Resulted XML Format Will be as below:


                                                        <?xml version="1.0" encoding="UTF-8"?>
                                                        <result>
                                                            <batch_id>171117172801751</batch_id>
                                                            <report>
                                                                <messageid>521452541</messageid>
                                                                <msisdn>961231211</msisdn>
                                                                <dlrstatus>DELIVRD</dlrstatus>
                                                                <status>000</status>
                                                            </report>
                                                            <report>
                                                                <messageid></messageid>
                                                                <msisdn>961231212</msisdn>
                                                                <dlrstatus></dlrstatus>
                                                                <status>006</status>
                                                            </report>
                                                        </result>
                                                    

6-Status Code

Status Code Table

This section Describes Status code returned while using api

CodeNameDescription
000NO_ERRORsuccess
001INVALID_LOGINEither System_id or password is invalid
002INVALID_REQUESTRequired parameters are missing or Invalid parameters or invalid values of parameters
003ACCOUNT_EXPIREDAccount has been Expired
004INSUF_BALANCEInsufficient balance
005INVALID_DEST_ADDRInvalid Destination Address
006NO_COVERAGERequested Destination is not Allowed
007SYSTEM_ERRORSystem Error
008INVALID_SENDERInvalid Source Address
009INVALID_TEXTInvalid message content
010INVALID_TYPEInvalid Message Type
050ACCESS_DENIEDEither Web Access Not Allowed or Account is Blocked
051IOSTREAM_ERRORInput Stream Error
052INVALID_BATCHIDInvalid Batch Id (must be 15 digits)
053NO_RECORDSRecords are not available for provided Batch Id
060INVALID_AMOUNTInvalid Amount For Recharge
061INVALID_OPERATIONInvalid operation (must be plus or minus)
062INVALID_BALANCE_MODEInvalid mode (must be credit or wallet)
063INVALID_TARGET_USERInvalid target User to recharge
064INVALID_API_ACCESS_IPAccess IP not valid
Your Cart