Send SMS API using Mobile Number
The Send SMS API using Mobile Number accepts the mobile number of a user as an input parameter and sends the SMS messages.
URL
The HTTP URL for Send SMS API using Mobile Number is:
http://<host or ip>:<port>/api/v1/message/sms
This service implements ‘Gateway Filter for Authentication’ to authenticate access of the service by a user.
Method
POST
Header
Based on the content format, the payload's request header includes Content-Type for:
- XML is text/xml;charset=UTF-8
- JSON is application/json;charset=UTF-8
Input Parameters
The following fields are input parameters:
Input Parameter | Level – Two | Level – Three | Level – Four | Required | Type | Description |
---|---|---|---|---|---|---|
smsServiceRequest | An array of smsServiceRequest objects | |||||
messages | An array of messages objects | |||||
message | An array of message objects | |||||
startTimestamp | Optional | string | Time relative to a starting point | |||
expiryTimestamp | Optional | string | Time relative to an ending point | |||
priorityService | Required | boolean | If priority service or not | |||
recipients | mobile (Required) | An array of recipients objects: -mobile | ||||
content | Optional | string | SMS description | |||
channel | Optional | string | Used to define type of SMS. For example Voice SMS or Text SMS. |
Sample Request
XML
<smsServiceRequest>
<messages>
<message>
<startTimestamp>0</startTimestamp>
<expiryTimestamp>0</expiryTimestamp>
<priorityService>false</priorityService>
<recipients>
<recipient mobile="+917799622269"/>
</recipients>
<content>sample sms message</content>
</message>
</messages>
</smsServiceRequest>
XML for Voice
<smsServiceRequest>
<messages>
<message>
<channel>voicesms</channel>
<startTimestamp>0</startTimestamp>
<expiryTimestamp>0</expiryTimestamp>
<priorityService>false</priorityService>
<recipients>
<recipient mobile="+917799622269"/>
</recipients>
<content>sample sms message</content>
</message>
</messages>
</smsServiceRequest>
JSON
{
"smsServiceRequest": {
"messages": {
"message": {
"startTimestamp": "0",
"expiryTimestamp": "0",
"priorityService": "true",
"recipients": {
"recipient": {
"mobile": "+919866694753"
}
},
"content": "sample sms message"
}
}
}
}
JSON for Voice SMS
{
"smsServiceRequest": {
"messages": {
"message": {
"startTimestamp": "0",
"expiryTimestamp": "0",
"priorityService": "true",
"recipients": {
"recipient": {
"mobile": "+919866694753"
}
},
"content": "sample sms message"
},
"channel": "voicesms"
}
}
}
}
Sample Response
XML
<smsResponse>
<code>200</code>
<description>Request Queued. </description>
<requestId>2318520209657194583</requestId>
</smsResponse>
JSON
{
"id": "4718462567639063760",
"message": "Request Queued. "
}
Response Status
Code | Description |
---|---|
Status 200 | Request queued |
Status 400 | No active audience members foundFailed to parse the input request |
Status 401 | Unauthorized request |
Status 500 | Server failure to process request |