Endpoints
We'll have two endpoints:
- REST (GET): /services/rest/message/status?username=[]&password=[]&documentId=[]
- SOAP: /services/ws/message?wsdl (method: status)
<soapenv:Envelope xmlns:soapenv= "http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser= "http://server.submission.mc5.smspl.com/" > <soapenv:Header/> <soapenv:Body> <username>?</username> <password>?</password> <documentId>?</documentId> </ser:status> </soapenv:Body> </soapenv:Envelope> |
What information to return?
For the REST endpoint (JSON)
If documentId does exist
{ "documentId" : "4fbb6c371a88393bc47baf32" , "recipient" : "48660703691" , "messageStatus" : "10" } |
for when documentId does not exist
{ "documentId" : "4fbb6c371a88393bc47baf32" , "messageStatus" : "0" } |
Note that we only guarantee to hold message for status query for 80 hours after message send datetime.
For the SOAP endpoint (XML):
<soap:Body> < return > <documentId>4fbb6cd21a88393bc47baf33</documentId> <recipient> 48660703691 </recipient> <messageStatus> 10 </messageStatus> </ return > </soap:Body> </soap:Envelope> |
Status codes
Basing on https://admin.smartmessagingservices.net/wiki/download/attachments/12386334/SMSPL-SW-807-MCOR-0001+-+Web+Services+API+-+V1.06.2.pdf?version=1&modificationDate=1337252411000 and https://admin.smartmessagingservices.net/wiki/display/MC4API/Web+Service+to+query+status. Some status codes are omitted as they can't (yet) occur in our application.
Status code | Priority | Final | Meaning | When? |
---|---|---|---|---|
0 | 1 | N | Unknown | Message with the given id not found. It is possible that the message was submitted, but not yet processed by a worker. Or that such a message doesn't exist. |
2 | 9 | Y | Delivered | Message was sent and Delivery Receipt was received |
3 | 6 | Y | Expired | Message delivery failed and message expired (SMSC will no longer try to deliver it) |
4 | 2 | Y | Deleted | Message was deleted by SMSC |
5 | 4 | Y | Undeliverable | Message undeliverable as determined by SMSC |
8 | 5 | Y | Rejected | Message rejected by SMSC |
10 | 7 | N | Submitted | Last event is "request received". Not yet routed. May be temporarily unroutable. |
11 | 8 | N | Sent | Last event is "sent" |
12 | 3 | Y | Not deliverable | Last event is "unroutable". There's no bind (even among inactive ones) that can accept the message. |
Priority relates to the status returned when a single message sent to us is longer than 160 characters and is sent as multiple parts to the SMSC making it possible for each message part to have a different status.
If message parts have different statuses, the status returned in the query process will be the lowest priority status within the relevant message parts. It is possible for one message part to show as delivered while the others show as sent. A multipart message will not display on a handset until all message parts are delivered so the valid total message status is sent and this is what your message status query will return. You can log into the user web application on MC5 and view the status of the individual message parts as each Outbound message to the SMSC shows as a separate entry in the SMS Out Volume Report
Status code | Final | Meaning | When? |
---|---|---|---|
-101 | Y | No username | |
-102 | Y | No password | |
-103 | Y | No document id | |
-104 | Y | Invalid recipient | Recipient number invalid - validation rules - numeric length: 8-16 inclusive |
-105 | Y | Invalid source | Sender number invalid - validation rules - in the system - hardcoded So alpha <2, 11>, digit < 3, 16> |
-106 | Y | Empty text | SMS text was empty |
-109 | Y | Invalid rotation algorithm provided | Available algorithms are: max_rotation, conversation |
-110 | Y | Invalid encoding name | Available encodings are e.g. "utf-16", "gsm", "iso-8859-1" etc. (see Send Single Message) |
-200 | Y | Invalid username/password | Last event: "invalid username/pass" |
-201 | Y | User disabled | Last event: "user disabled" |
-202 | Y | User blocked | Last event: "user blocked" |
-210 | Y | Insufficient credits | Last event: "no credits" |
-230 | Y | Document ID not matched | User does not have rights to check message status |
-240 | Y | Invalid (not supported) replyTo value | |
-910 | Y | SMSC error | Last event: "send failure" |
-999 | Y | Internal error |
Missing status codes:
- -110 (invalid xml): not possible? It would be an WS-framework error?
- -211 (invalid service), -930 (status query timeout): N/A
- -900 (service not available): ?
- -940 (query too fast)
Submission URLs
To make the URLs uniform, the endpoints to submit messages will be:
- REST (GET/POST): /services/rest/message/sendSingle2?username=[]&password=[]&documentId=[]&text=[]&replyTo=[]&recipient=[]&sender=[]
- SOAP: /services/ws/message?wsdl (method: sendSingle2)