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)
{ "documentId" : "4fbb6c371a88393bc47baf32" , "recipient" : "48660703691" , "messageStatus" : "10" } |
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://secure.mghhosting.com/wiki/download/attachments/12386334/SMSPL-SW-807-MCOR-0001+-+Web+Services+API+-+V1.06.2.pdf?version=1&modificationDate=1337252411000 and https://secure.mghhosting.com/wiki/display/MC4API/Web+Service+to+query+status. Some status codes are omitted as they can't (yet) occur in our application.
Status code | Meaning | When? |
---|---|---|
0 | 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. |
1 | En route | Last event is "routed" or "re-routed" (after a bind failure) |
2 | Delivered | Message was sent and Delivery Receipt was received |
3 | Expired | Message delivery failed and message expired (SMSC will no longer try to deliver it) |
5 | Undeliverable | Last event is "unroutable". There's no bind (even among inactive ones) that can accept the message. |
7 | Invalid | Last event is "validation failed" (wrong text, recipient, etc.) |
8 | Rejected | Message rejected by SMSC |
10 | Submitted | Last event is "request received". Not yet routed. May be temporarily unroutable. |
11 | Sent | Last event is "sent" |
Missing status codes: 4 (deleted), 6 (accepted), 9 (pending)
Status code | Meaning | When? |
---|---|---|
-101 | No username |
|
-102 | No password |
|
-103 | No document id |
|
-104 | Invalid recipient | Recipient number invalid |
-105 | Invalid source | Sender number invalid |
-106 | Empty text | SMS text was empty |
-107 | Missing sender or replyTo | Both sender and replyTo value were missing. Exactly of them should be present. |
-108 | Both sender and replyTo provided | Both sender and replyTo were provided. Exactly one of them is allowed. |
-200 | Invalid username/password | Last event: "invalid username/pass" |
-201 | User disabled | Last event: "user disabled" |
-210 | Insufficient credits | Last event: "no credits" |
-230 | Document ID not matched | User does not have rights to check message status |
-240 | Invalid (not supported) replyTo value | |
-910 | SMSC error | Last event: "send failure" |
-999 | 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)