Get All Commands
The Get All Commands API enables you to get details of all the command mapped to an inbound number, such as BAL command is used to fetch balance amount details of an user's account.
URL
The HTTP URL for Get All Command API is:
http://<host>:<port>/api/v1/twowaysms/<number-id>/command?start=0&pageSize=20
NOTE: <number-id>: Here, number ID refers to an ID that is used to map inbound number with internal data record.
This service implements ‘Gateway Filter for Authentication’ to authenticate access of the service by a user.
Method
GET
Output Parameters
The following fields are output parameters:
Sample Response
{ "inboundSMSCommands": [{ "id": 24, "replyForInvalidReq": "Try again", "commandName": "Customer care", "command": "53515", "inboundParams": "", "description": "customer care", "replyMessageFormat": "", "smsClientAPIConfig": { "apiUrl": "google.com", "requestPayload": "", "headers": [], "params": [], "requestMethod": "POST", "authenticationType": "BASIC", "responseContentType": "application/json", "appKey": "", "appSecret": "", "username": "admin", "password": "admin", "mbaasAuthUrl": "" }, "replyParamsConfig": { "paramConfigs": [] }, "createdBy": "admin", "createdDateStr": "08/25/2016 02:22:12 PM IST", "lastModifiedBy": "admin", "lastModifiedDateStr": "09/30/2016 01:43:12 PM IST", "replyForFailedCases": "" }, { "id": 25, "replyForInvalidReq": "INVALID", "commandName": "BILL-719", "command": "54123", "inboundParams": "month,year", "description": "balance Enquiry", "replyMessageFormat": "##text## for ##number## with ##amount##", "smsClientAPIConfig": { "apiUrl": "http://localhost:9080/ConfiguredSMSClient/receiver/keys", "requestPayload": "month=##month##&year=##year##", "headers": [{ "name": "H1", "value": "H1Value" }, { "name": "H2", "value": "H2Value" }], "params": [{ "name": "UserName", "value": "##First Name##" }, { "name": "Month", "value": "##month##" }], "requestMethod": "POST", "authenticationType": "BASIC", "responseContentType": "application/json", "appKey": "", "appSecret": "", "username": "admin", "password": "admin", "mbaasAuthUrl": "" }, "replyParamsConfig": { "paramConfigs": [{ "paramName": "number", "paramPath": "$.paramConfigs[1].value", "secured": false }, { "paramName": "text", "paramPath": "$.paramConfigs[0].value", "secured": false }, { "paramName": "amount", "paramPath": "$.paramConfigs[2].value", "secured": false }] }, "createdBy": "admin", "createdDateStr": "09/27/2016 09:49:41 PM IST", "lastModifiedBy": "admin", "lastModifiedDateStr": "09/30/2016 12:35:54 PM IST", "replyForFailedCases": "Try again after some time." }, { "id": 27, "replyForInvalidReq": "INVALID", "commandName": "BILL-71", "command": "BILL", "inboundParams": "month,year", "description": "balance Enquiry", "replyMessageFormat": "##text## for ##number## with ##amount##", "smsClientAPIConfig": { "apiUrl": "http://localhost:9080/ConfiguredSMSClient/receiver/keys", "requestPayload": "month=##month##&year=##year##", "headers": [{ "name": "H1", "value": "H1Value" }, { "name": "H2", "value": "H2Value" }], "params": [{ "name": "UserName", "value": "##First Name##" }, { "name": "Month", "value": "##month##" }], "requestMethod": "POST", "authenticationType": "BASIC", "responseContentType": "application/json", "appKey": "", "appSecret": "", "username": "admin", "password": "admin", "mbaasAuthUrl": "" }, "replyParamsConfig": { "paramConfigs": [{ "paramName": "number", "paramPath": "$.paramConfigs[1].value", "secured": false }, { "paramName": "text", "paramPath": "$.paramConfigs[0].value", "secured": false }, { "paramName": "amount", "paramPath": "$.paramConfigs[2].value", "secured": false }] }, "createdBy": "admin", "createdDateStr": "09/30/2016 01:13:54 PM IST", "lastModifiedBy": "admin", "lastModifiedDateStr": "09/30/2016 01:13:54 PM IST", "replyForFailedCases": "Please try again after some time." }, { "id": 29, "replyForInvalidReq": "INVALID", "commandName": "UNSUBSCRIBE", "command": "55555", "inboundParams": "month,year", "description": "balance Enquiry", "replyMessageFormat": "##text## for ##number## with ##amount##", "smsClientAPIConfig": { "apiUrl": "http://localhost:9080/ConfiguredSMSClient/receiver/keys", "requestPayload": "month=##month##&year=##year##", "headers": [{ "name": "H1", "value": "H1Value" }, { "name": "H2", "value": "H2Value" }], "params": [{ "name": "Year", "value": "##year##" }, { "name": "Month", "value": "##month##" }], "requestMethod": "POST", "authenticationType": "BASIC", "responseContentType": "application/json", "appKey": "", "appSecret": "", "username": "admin", "password": "admin", "mbaasAuthUrl": "" }, "replyParamsConfig": { "paramConfigs": [{ "paramName": "number", "paramPath": "$.paramConfigs[1].value", "secured": false }, { "paramName": "text", "paramPath": "$.paramConfigs[0].value", "secured": false }, { "paramName": "amount", "paramPath": "$.paramConfigs[2].value", "secured": false }] }, "createdBy": "admin", "createdDateStr": "09/30/2016 01:59:46 PM IST", "lastModifiedBy": "admin", "lastModifiedDateStr": "09/30/2016 01:59:46 PM IST", "replyForFailedCases": "Please try again after some time." }], "total": 4 }
Response Status
Code | Description |
---|---|
Status 200 | Inbound commands JSON |
Status 400 | No SMS commands found for this number |
Status 401 | Unauthorized request |
Status 500 | Server failure to process request |