Query Message Status
service address /api/MessageStatus
verb POST
body application/json
If you get a final status like -200 when you send the MT message the message will not then be available for query. Only message send with return status 11 are available for query
Also your account needs to be setup for allowing MO queries. Currently this query can only be used on a single thread. Using multiple threads will most likely return the same result for multiple queries and unnecessarily add load to the system.
When implementing the Querring process you will need to have us approve you application logic. This is so we can confirm you will not over query our system.
Normal Implementation plan;
- use the query to receive non polled messages - the frequency you call this method will determine on your message send rate and behaviour
- Messages will receive a final status not later than 49 hours after it is sent.
- Use the query by document Id only to check for Status if you have not otherwise got a final status after this 49 hour period.
Query Plan
step | Query |
---|---|
1 | query for unpolled statuses every 2 mins if you are sending messages - if not query every 15 mins |
2 | if you receive 50 statuses in one request immediately requery |
3 | if after 8 days after sending a message if you do not have a final status query by messageId to get a final status. |
Parameter Options
name | meaning | example |
---|---|---|
username | api username to intelli's sms webapplication (mandatory) | |
password | api password to intelli's sms webapplication (mandatory) | |
unpolled | whether or not you have collected these message statuses before (mandatory) | must be either true or false. if set to true the below parameters are ignored and you will be returned the first 50 final statuses not previously polled. if you receive 50 (the max) poll again immediately. |
documentId | You want the current status for messages in the document that you sent | This will return messages of all statuses not just final status. |
messageId | You only want to query status for one MT message | This will return a message of any statuses not just a final status. |
Not that if unpolled is set to "false", then you need to provide either a documentId or a messageId or not message status will be returned.
If you query a message that does not have a final status you will not get a status returned for the message. This means the message is still enroute or does not exist. Only final message statuses are returned.
Messages with an initial send response other than 11 are not able to be queried as you already have the final status.
sample body to query for unpolled statuses
{ "username":"youruser", "password":"#######", "unpolled":"true" }
sample code to query for status by DocumentId
{ "username":"youruser", "password":"######", "unpolled":"false", "documentId":"b72d5c82-4131-4a45-8440-4c1484c2724b" }
order of priority if more than one value set out of unpolled, documentId, messageId
1, unpolled, 2. documentId, 3. messageId.
Response
{ "queryStatus": "0", "messagesStatus": [ { "messageId": "13fc2bcc-cc78-4450-a41e-cf33fc1a0551", "documentId": "b72d5c82-4131-4a45-8440-4c1484c2724b", "status": "11", "sent": "2017-05-30 12:31:29 +10:00", "finalStatusSet": "", "sender": "61401002002", "recipient": "61401328025" }, { "messageId": "407c7410-54c6-4535-9fb6-ac5da259d3f3", "documentId": "b72d5c82-4131-4a45-8440-4c1484c2724b", "status": "2", "sent": "2017-05-30 12:31:30 +10:00", "finalStatusSet": "2017-05-30 12:33:15 +10:00", "sender": "61401002002", "recipient": "61401328029" } ] }
Because message sent to sms.smartmessagingservices.net are forward to our core messaging gateway you may get an initial response of 11 when you send a message but still get a response from the query process of -200 or -210. If you do get this response from our core messaging gateway - call us to resolve the issue.