HTTP API
Integration Manual
1
Contents
Introduction:................................................................................................................................................. 3
1. Sending SMS: .................................................................................................................................... 4
1.1. HTTP(s) Get request: ................................................................................................................ 4
1.2. HTTP(s) Post request: ............................................................................................................... 4
1.3. GET/POST Send SMS Validate API ........................................................................................... 5
1.4. Send SMS Dynamic DLR API: .................................................................................................... 5
1.5. Send Message (Send Rate in Response) .................................................................................. 6
1.6. Send SMS Response: ................................................................................................................ 7
2. Client Global DLR API: ...................................................................................................................... 9
2.1. URL Http API POST: .................................................................................................................. 9
2.2. Example of Request JSON body : ............................................................................................. 9
2.3. URL GET DRL API example:..................................................................................................... 10
3. Vendor: ........................................................................................................................................... 11
3.1. Global Get Submit SMS API Request: .................................................................................... 11
3.2. Global Post Submit SMS API Request: ................................................................................... 11
3.3. DLR Listener API: .................................................................................................................... 11
3.4. GetSMS API: ............................................................................................................................ 15
Appendix A ................................................................................................................................................. 18
Appendix B.................................................................................................................................................. 19
2
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.
You submit all your requests over HTTP/HTTPs in the host: https://httpsmsc02.montymobile.com
The parameters used for sending the SMS messages are described in the following:
• 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 Monty Mobile 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
3
1. Sending SMS:
1.1. HTTP(s) Get request:
A single SMS is sent via the below URL by filling the correspondent parameters:
https://httpsmsc02.montymobile.com/HTTP/api/Client/SendSMS?username=XXXXX&password=XXXXX
&destination=XXXXXXXX&source=XXXXX&text=HelloTestMEssage&dataCoding=0
Multiple Messages are sent via the below URL by filling the correspondent parameters:
https://httpsmsc02.montymobile.com/HTTP/api/Client/SendSMS?username=[username]&password=[p
assword]&source=[sourcenumber]&destination=[destinationnumber,destinationnumber2]
&text=[message text]&datacoding=[Data coding number]
1.2. HTTP(s) Post request:
The messages are submitted by HTTP(s) post request via the following URI:
https://httpsmsc02.montymobile.com/HTTP/api/Client/SendSMS.
The HTTP request Headers contains the following parameters:
o Username
o Password
If JSON:
o Content-Type: application/json
If XML:
o Content-Type: application/XML
The HTTP Body request contains the following parameters:
o destination
o source
o text
o Data Coding
JSON Example
{
"destination":"XXXXXXXXXX",
"source":"XXXX",
"text":"XXXX",
"dataCoding":0
}
4
XML Example
<SendSMSRequest>
<dataCoding>0</dataCoding>
<destination>96171755555</destination>
<source>Facebook1</source>
<text>Hello World</text>
</SendSMSRequest>
1.3. GET/POST Send SMS Validate API
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.
URL Base: http://[URL]/api/Client/SendSmsVal
For example:
http://[URL]/api/Client/SendSmsVal?username=XXX&password=XXX&destination=99999999222112&so
urce=Facebook&text=HelloTestMEssage&dataCoding=0
As this Destination is invalid the below will be the response.
Response:
{
"ErrorCode": -12,
"ErrorDescription": "InvalidDestination",
"SMS": [],
"MessageCount": 0,
"MessageParts": 0
}
1.4. Send SMS Dynamic DLR API:
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
1.4.1. GET Send SMS Dynamic API:
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:
5
https://[URL]/HTTP/api/Client/SendSMSDyn?username=XXXXX&password=XXXXX&destination=XXXXXX
XX&source=XXXXX&text=HelloTestMEssage&dataCoding=0&cbkUrl=[URL]
Multiple Messages are sent via the below URL by filling the correspondent parameters:
https://[URL]/HTTP/api/Client/SendSMSDyn?username=[username]&password=[password]&source=[so
urcenumber]&destination=[destinationnumber,destinationnumber2]&text=[message
text]&datacoding=[Data coding number]&cbkURL=[URL]
1.4.2. POST Send SMS Dynamic API:
The messages are submitted by HTTP(s) post request via the following URI:
https://[URL]/HTTP/api/Client/SendSMSDyn
The HTTP request Headers contains the following parameters:
o Username
o Password
o Json Content-Types ( As example: Content-Type: application/json)
The JSON HTTP Body request contains the following parameters:
o destination
o source
o text
o Data Coding
o cbkUrl (call back URL)
Example of HTTP(s) post request:
{
"destination":"XXXXXXXXXX",
"source":"XXXX",
"text":"XXXX",
"cbkUrl":"XXXX",
"dataCoding":0
}
1.5. Send Message (Send Rate in Response)
This API will have the same Parameters as the (SendSMS API). The Difference is in the response where it
will send the rate and the total rate.
GET:
6
http://[URL]/api/Client/SendMessage?username=XXXXX&password=XXXXX&destination=XXXXXXXX&so
urce=XXXXX&text=HelloTestMEssage&dataCoding=0
POST:
http://[URL]/api/Client/SendMessage
Body (JSON) OR (XML)
1.6. Send SMS Response:
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)
• Rate**: the rate extracted from RoutingInstruction table
• TotalRate**: Total rate based on message parts
• 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
* *THIS IS THE ADDITIONAL RESPONSE FOR (1.5) API
The error codes Check Appendix A*
N.B: In case you are sending multiple messages, you shall receive the below response.
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,
7
MessageParts:2
}
**Sample Response
{
"ErrorCode": 0,
"ErrorDescription": "Ok",
"SMS": [
{
"Rate": 0.0567,
"TotalRate": 0.0567,
"ErrorCode": 0,
"Id": "8d73915d-f864-4f27-9fa0-0223d7c48b27",
"OriginatingAddress": "Facebook1",
"DestinationAddress": "96171755555"
}
],
"MessageCount": 1,
"MessageParts": 1
}
8
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.
2.1. URL Http API POST:
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
• Status: Message status
o 2 = Delivered
o 3 = Expired
o 4 = Deleted
o 5 = Undelivered
o 6 = Accepted
o 7 = Invalid
o 8 = Rejected
• Message Id: to be used in case if any enquiry about the message
• Username: username of Monty Mobile Account
• Password: password of Monty Mobile Account
• MCCMNC: value of the MCC and MNC concatenated in one string such as “51002”
• Rate: Rate of the sms
2.2. Example of Request JSON body :
{
"CallBackResponse":{
"MobileNo":"$NUMBER$",
"Senddate":"$SENDDATE$",
"ReceiveDate":"$RECEIVEDATE$",
9
"Status":"$STATUS$",
"MessageId":"$MessageId$",
"StatusId":"$StatusId$",
"Username":"$Username$",
"Password":"$Password$",
"MCCMNC":"$MCCMNC$",
"Rate":"$Rate$",
"VendorCode":"SMSVEN00001"
}
}
The most used DLR Request written in Json language is:
{
"messageId": "$MessageId$",
"statusId": "$StatusId$"
}
2.3. URL GET DRL API example:
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$
10
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.
3.1. Global Get Submit SMS API Request:
The Global HTTP vendor will provide a URL such as below example:
http://[ip]/api/HttpSimulator/SubmitSMS?username=[Username]&password=[Password]&source=[S
ource]&destination=[Destination]&MessageText=[Content]
&dataCoding=[DataCoding]
3.2. Global Post Submit SMS API Request:
The Global HTTP vendor will provide a URL such as below example:
http://[ip]/api/HttpSimulator/SubmitSMSPost
The request could be written in Json language.
Request JSON Body example:
{
"destination":"$destination$",
"source":"$source$",
"content":"$content$",
"username":"$username$",
"password":"$password$",
"dataCoding":"$datacoding$"
}
3.3. DLR Listener API:
We provide our HTTP Vendors with a Global DLR Listener GET and POST API so that they can send us the
Delivery report.
11
3.3.1. GET DLR Listener API:
URL Example:
https://httpsmsc02.montymobile.com/HTTP/api/Vendor/DLRListener?username=XXXX&password=X
XXX&sender=XXXX&destination=XXXXXXXXXX&messageId=14fce738-d50a-46b6-9e8a-
4b83444bae6e&deliveryStatus=2&dateReceived=2/26/2019%2012:00:00%20AM&description=Deliver
ed
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"
}
Error Codes and descriptions are:
• 0 = Ok
• 1 = Invalid Credentials
• 2 = Credentials Required
• 3 = Invalid Query String Parameters
• 10 = Internal Server Error
3.3.2. Post DLR Listener API:
We provide our HTTP Vendors with a Global DLR Listener POST API so that they can send us the Delivery
report.
Example of DLR POST URL
https://httpsmsc02.montymobile.com/HTTP/api/Vendor/DLRListener
The HTTP request Headers contains the following parameters:
o username = “username”
12
o password = “password”
o Json Content-Types( As example: Content-Type: application/json)
Username and password will be provided by Monty Mobile.
The JSON HTTP Body request contains the following parameters:
o sender
o destination
o messageId
o deliveryStatus
o dateReceived
o description
o username
o password
The messageId in the above request is provided by the provider.
Example of HTTP Request Body:
{
"sender":"XXXX",
"destination":"XXXXXXXXXX",
"messageId":"f09a7735-4939-4548-ae50-f035b75dcde4",
"deliveryStatus":"2",
"dateReceived":"2019-02-26T00:00:00",
"description":"Delivered",
"username":"XXXX",
"password":"XXXX"
}
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"
13
}
Error Code and descriptions are:
• 0 = Ok
• 1 = Invalid Credentials
• 2 = Credentials Required
• 3 = Invalid Query String Parameters
• 10 = Internal Server Error
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.
DLR URL example:
https://httpsmsc02.montymobile.com/HTTP/api/Vendor/DLRListenerBasic?ConnectionId=XXX&MessageI
d=XXX&Status=2
The connectionId is an integer constant that we provide to the providers.
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"
}
Error Codes and descriptions are:
• 0 = Ok
• 1 = Invalid Credentials
• 2 = Credentials Required
• 3 = Invalid Query String Parameters
• 10 = Internal Server Error
14
3.3.4. GET DLRListenerGet API:
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.
DLR URL example:
https://httpsmsc02.montymobile.com/HTTP/api/Vendor/DLRListenerGet?Connecti
onId=XXX&Status=2&(etc...)
The connectionId is an integer constant that we provide to the providers.
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"
}
Error Codes and descriptions are:
• 0 = Ok
• 1 = Invalid Credentials
• 2 = Credentials Required
• 3 = Invalid Query String Parameters
• 10 = Internal Server Error
3.4. GetSMS API:
15
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:
In the get Method we have 2 ways that the Client can use to extract the message details.
Method 1: Get 1 message SMS only
http://[URL]/api/client/getsms?MessageId={MessageID}
Method 2: Get all the messages details having the same Destination Number
http://[URL]/api/client/getsms?clientid={ClientID}&Destination={DestinationNumber}&FromDate={Date
}
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.
3.4.2. Post SMS API:
Same parameters as in GET in both methods. Examples are provided below:
POST URL : http://[URL]/api/client/getsms
Method 1 body request example:
{ "messageId": "7c3f3a16-f1b9-4024-b18d-c5433412ca96" }
Method 2 body request example:
{
"destination": "XXXXXXXXX",
"fromDate": "YYYY-MM-DD HH:MM:SS",
"clientId": "E2983EE3-836B-EB11-A253-BBBBBBBBB"
}
3.4.3. Responses:
In case of success the below are the responses:
{
"ErrorCode": 0,
"ErrorDescription": "Ok",
"SMSResponse": [
{
"OriginatingAddress": "XXXXXX",
16
"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"
}
]
}
In case of failure Check Appendix B* for Error codes.
Sample Response Below:
{
"ErrorCode": -13,
"ErrorDescription": "InvalidDate",
"SMSResponse": []
}
17
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
18
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
19