WIS Telecom - HTTP Gateway API Configuration
WIS Telecom - HTTP Gateway API Configuration
WIS Telecom
Contents
Introduction: ................................................................................................................................................ 2
1. Sending SMS: ....................................................................................................................................... 3
1.1. HTTP(s) Get request: .................................................................................................................... 3
1.2. HTTP(s) Post request: ................................................................................................................... 4
1
1.3. GET/POST Send SMS Validate API ............................................................................................... 4
1.4. Send SMS Dynamic DLR API: ........................................................................................................ 5
1.5. Send SMS Response: .................................................................................................................... 6
2. Client Global DLR API: ......................................................................................................................... 8
2.1. URL Http API POST: ...................................................................................................................... 8
2.2. Example of Request JSON body : ................................................................................................. 9
2.3. URL GET DRL API example: .......................................................................................................... 9
3. Vendor: ................................................................................................................................................ 9
3.1. Global Get Submit SMS API Request: .......................................................................................... 9
3.2. Global Post Submit SMS API Request:....................................................................................... 10
3.3. DLR Listener API: ........................................................................................................................ 10
3.4. GetSMS API: ............................................................................................................................... 14
Appendix A ................................................................................................................................................. 17
Appendix B ................................................................................................................................................. 18
Introduction:
This document provides the guidelines on how to use the HTTP(s) SMS API interface for sending a single
SMS or bulk SMS to valid Mobile phone numbers.
The parameters used for sending the SMS messages are described in the following:
2
• Username: represents the username of the created account.
• Password: represents the username of the created account.
• Destination: is the valid mobile number where the SMS is to be sent. (Note the + sign is not
supported).
• Source: is the Sender ID of the sent message.
• Text/content: is the body of the message.
• Data coding: defines the encoding format:
o Default GSM 7 bit = 0
o ISO-88592 Eastern European Latin2= 1
o ISO-88591 Western European Latin1 = 3
o ISO-88594 North European Latin4 = 4
o ISO-2022 Japanese = 5
o ISO-88595 Cyrillic = 6
o ISO-88598 Hebrew = 7
o Unicode UCS2 = 8
In addition, this guideline covers the connection between WIS Telecom Gateway and the HTTP vendor.
The parameters used for receiving DLRs are described in the following:
• Username: represents the username of the created account.
• Password: represents the username of the created account.
• Sender: is the Sender ID of the sent message.
• Destination: is the Sender ID of the sent message.
• MessageId: to be used in case if any enquiry about the message.
• Delivery Status: the code of the delivery status.
• Description: description of the delivery status.
• Datereceived: the received date of the message.
• Data coding: defines the encoding format of the message.
• Call Back URL: the DLR listener URL.
1. Sending SMS:
A single SMS is sent via the below URL by filling the correspondent parameters:
3
http://195.191.165.17:31107/MO/Client/SendSMS?username=XXXXX&password=XXXXX&destination=X
XXXXXXX&sour ce=XXXXX&text=HelloTestMEssage&dataCoding=0
Multiple Messages are sent via the below URL by filling the correspondent parameters:
http://195.191.165.17:31107/MO/Client/SendSMS?username=[username]&password=[password]&sou
rce=[sourcenu mber]&destination=[destinationnumber,destinationnumber2] &text=[message
text]&datacoding=[Data coding number]
The messages are submitted by HTTP(s) post request via the following URI:
http://195.191.165.17:31107 /MO/Client/SendSMS
We provide our HTTP clients with GET and Post methods, the new feature is to check whether the
number used is available in our prefix list and return an error of Invalid Destination if not found.
4
For example:
http://195.191.165.17:31107/MO/Client/SendSmsVal?username=XXX&password=XXX&destination=999
99999222112&s ource=Facebook&text=HelloTestMEssage&dataCoding=0
Response:
{
"ErrorCode": -12,
"ErrorDescription": "InvalidDestination",
"SMS": [],
"MessageCount": 0,
"MessageParts": 0
}
We provide our HTTP clients with Send SMS which supports Dynamic DLR Listeners where they use
multiple URLs sent in the request for us to use to return DLR to the client. It is also available for GET and
POST Methods
The client should send us all below parameters including the needed DLR Listener in each submit.
A single SMS is sent via the below URL by filling the correspondent parameters:
http://195.191.165.17:31107/MO/Client/SendSMSDyn?username=XXXXX&password=XXXXX&destinatio
n=XXXXXXXX&s ource=XXXXX&text=HelloTestMEssage&dataCoding=0&cbkUrl=[URL]
Multiple Messages are sent via the below URL by filling the correspondent parameters:
http://195.191.165.17:31107/MO/Client/SendSMSDyn?username=[username]&password=[password]&
source=[sourcen umber]&destination=[destinationnumber,destinationnumber2]&text=[message
text]&datacoding=[Data coding number]&cbkURL=[URL]
5
The messages are submitted by HTTP(s) post request via the following URI:
https://http://195.191.165.17:31107/MO/Client/SendSMSDyn
After submitting the HTTP request using get or post method, you will get a response containing the
following parameters:
• ErrorCode: State of the message. (Values are shown below)
• Error Description: Status of the message. (Values are shown below)
• SMS entity contains the following parameters:
o ErrorCode: State of the message. (Values are shown below)
o Id: to be used in case if any enquiry about the message.
o OriginatingAddress: Alpha/Numeric/AlphaNumeric source of the Message. (Sender ID)
o DestinationAddress: Mobile Destination Number.
• Message Count: the number of sent messages.
• Message Parts: the number of part for each message.
N.B: In case you are sending multiple messages, you shall receive the below response.
6
Here is an example of an HTTP(s) Response:
{
ErrorCode:0,
ErrorDescription:"Ok",
SMS:[
{
ErrorCode:0,
Id:"52be91a8-0a1e-4cfe-ab5c-68fc0f96b2f0",
OriginatingAddress:"XXXX",
DestinationAddress:"XXXXXXXXXX",
}
],
MessageCount:2,
MessageParts:2
}
7
2. Client Global DLR API:
After you have sent a couple of messages, you are able to check if they were successfully delivered by
providing an HTTP URL in order to push the DLR into it.
The JSON request body can have multiple parameters (Name, value and description) based on the client
needs. The client can add and edit many parameters to the request
The below is an example of the parameters names with its Values & Description:
• MobileNumber: Mobile Phone Number.
• SendDate: the date of sending message.
• Receive Date: the date of receiving message.
• StatusId: The status id of the message
o 2
o 3
o 4
o 5
o 6
o 7
o 8
8
2.2. Example of Request JSON body :
{
"CallBackResponse”: {
"MobileNo":"$NUMBER$",
"Senddate":"$SENDDATE$",
"ReceiveDate":"$RECEIVEDATE$",
"Status":"$STATUS$",
"MessageId":"$MessageId$",
"StatusId":"$StatusId$",
"Username":"$Username$",
"Password":"$Password$",
"MCCMNC":"$MCCMNC$",
"Rate":"$Rate$",
"VendorCode":"SMSVEN00001"
}
}
{
"messageId": "$MessageId$",
"statusId": "$StatusId$"
}
http://[IP]/GetDLR?MobileNo=$NUMBER$&Senddate=$SENDDATE$&ReceiveDate=$RECEIVEDATE$&Sta
tus=$STATUS$&MessageId=$MessageId$&StatusId=$StatusId$&Username=$Username$&Password=$P
assword$&mccmnc=$MCCMNC$&rate=$Rate$
3. Vendor:
Vendors of type HTTP can now be created on our Gateway that can Submit SMS through HTTP API Get
or Post which are detailed below.
We provide a Global HTTP Vendor Provider Submit SMS APIs for GET and POST and a global DLR Listener
GET or POST, in addition and most importantly, we can tailor easily a vendor HTTP API provider specific
for vendors that does not support our Global HTTP Vendor provider.
9
The Global HTTP vendor will provide a URL such as below example:
http://195.191.165.17:31107/api/HttpSimulator/SubmitSMS?username=[Username]&password=[Pas
sword]&source=[S
ource]&destination=[Destination]&MessageText=[Content]&dataCoding=[DataCoding]
The Global HTTP vendor will provide a URL such as below example:
http://195.191.165.17:31107/api/HttpSimulator/SubmitSMSPost
We provide our HTTP Vendors with a Global DLR Listener GET and POST API so that they can send us the
Delivery report.
URL Example:
http://195.191.165.17:31107/MT/api/Vendor/DLRListener?username=XXXX&password=XXXX&sende
r=XXXX&desti nation=XXXXXXXXXX&messageId=14fce738-d50a-46b6-
9e8a4b83444bae6e&deliveryStatus=2&dateReceived=2/26/2019%2012:00:00%20AM&description=D
elivered
The messageid in the above URL sample is the Message ID of the provider.
The delivery status with their errors and description are listed in the below:
o 2 = Delivered
o 3 = Expired
10
o 4 = Deleted
o 5 = Undelivered
o 6 = Accepted
o 7 = Invalid
o 8 = Rejected
Example of a DLR-Response:
{
"ErrorCode": 0,
"ErrorDescription": "Ok"
}
We provide our HTTP Vendors with a Global DLR Listener POST API so that they can send us the Delivery
report.
11
o dateReceived
o description
o username
o password
Note: If username and password are not provided in the HTTP Header, they will be read from the HTTP
request body.
The delivery status with their errors and description are listed in the below:
o 2 = Delivered
o 3 = Expired
o 4 = Deleted
o 5 = Undelivered
o 6 = Accepted
o 7 = Invalid
o 8 = Rejected
Example of a DLR-Response:
{
"ErrorCode": 0,
"ErrorDescription": "Ok"
}
12
3.3.3. Get DLRListenerBasic API:
We provide our HTTP Vendors with a Basic DLR Listener so that they can send us the Delivery report.
https://IP:Port/MT/api/Vendor/DLRListenerBasic?ConnectionId=XXX&MessageId=XXX&Status=2
The messageid in the above URL sample is the Message ID of the provider.
The delivery status with their errors and description are listed in the below:
o 2 = Delivered
o 3 = Expired
o 4 = Deleted
o 5 = Undelivered
o 6 = Accepted
o 7 = Invalid
o 8 = Rejected
Example of a DLR-Response:
{
"ErrorCode": 0,
"ErrorDescription": "Ok"
}
13
We provide our HTTP Vendors with a Get DLR Listener which is dynamic and where we can add a
querystring as requested by vendor so that they can send us the Delivery report.
https://IP:Port/MT/api/Vendor/DLRListenerGet?ConnectionId=XXX&Status=2&(et
c...)
Providers are free to send us whatever parameters they want by replacing the (etc…) part in the URL
above.
The delivery status with their errors and description are listed in the below:
o 2 = Delivered
o 3 = Expired
o 4 = Deleted
o 5 = Undelivered
o 6 = Accepted
o 7 = Invalid
o 8 = Rejected
Example of a DLR-Response:
{
"ErrorCode": 0,
"ErrorDescription": "Ok"
}
We provide our HTTP Clients with a GetSMS API GET and POST so that they can extract the message
details.
3.4.1. GET SMS API:
14
In the get Method we have 2 ways that the Client can use to extract the message details.
http://[URL]/MO/Client/getsms?MessageId={MessageID}
Method 2: Get all the messages details having the same Destination Number
http://[URL]/MO/Client/getsms?clientid={ClientID}&Destination={DestinationNumber}&FromDate={Dat
e}
Noting that both Methods will extract the data for the last 3 days only and for method 2 will extract only
the latest 10 messages with same destination number.
***ClientID: Check with BPal team to provide the Bpal Client ID.
{ "messageId": "7c3f3a16-f1b9-4024-b18d-c5433412ca96" }
{
"destination": "XXXXXXXXX",
"fromDate": "YYYY-MM-DD HH:MM:SS",
"clientId": "E2983EE3-836B-EB11-A253-BBBBBBBBB"
}
3.4.3. Responses:
{
"ErrorCode": 0,
"ErrorDescription": "Ok",
"SMSResponse": [
{
"OriginatingAddress": "XXXXXX",
15
"DestinationAddress": "XXXXXXXXXXX",
"Country": "Lebanon",
"Operator": "MTC Touch",
"MessageId": "7c3f3a16-f1b9-4024-b18d-c5433412ca96",
"Message": "this is a test sample",
"DeliveryTime": "2/16/2021 10:04:01 AM",
"DeliveryStatus": "UNDELIV",
"CreatedDate": "2021-02-16T10:04:01"
}
]
}
16
Appendix A
In the below list you will find all possible error code that may be received upon Testing the API. Most
of the Error code as self-explanatory and the reflect the area that requires attention.
• Ok = 0
• NoMessage = -1
• NoSource = -2
• NoDestination = -3
• UnsupportedDestination = -4
• InvalidCredentials = -5
• NoCredit = -6
• InvalidDataCoding = -7
• IPNotWhiteListed = -8
• UnknownError = -10
• InvalidInstanceConnection = -11
• InvalidDestination = -12
17
Appendix B
In the below list you will find all possible error code that may be received upon Testing the API. Most
of the Error code as self-explanatory and the reflect the area that requires attention.
• InvalidDate = -13
• InvalidMessageId = -14
• InvalidClientId = -15
• InvalidParameters = -16
18