Query a Message Status

Base URI

https://rest.telemessage.com

Endpoint

POST /rest/message/status

Query the status of a message delivery to the message recipients.

Request

Provide the sending user’s authentication details and the message contents.

Property

Type

Description

loginDetails
AuthenticationDetails The credentials of the user sending the message.
messageID
long The unique id of the message that was returned by send.
messageKey
String The unique key of the message that was returned by send.

Response

Returns a StatusMessageResponse object, containing the response result code and description. A successful status request will also contain requested messageID, messageKey and an array of RecipientStatus objects (one for each recipient the message was sent to), containing the delivery status to each specific recipient.

Property

Type

Description

resultCode
integer Numeric representation of result (see appendix A).
resultDescription
String Textual explanation of result (see appendix A).
recipients
Array of RecipientStatus objects One or more RecipientStatus objects.
messageID
integer requested message id
messageKey
String requested message key

Explore additional code samples & developer resources:

JAVA LibraryPHP LibrarySOAP APIXML APIHTTP API, and more

[
   {
      "class":"telemessage.web.services.AuthenticationDetails",
      "username":"john_doe",
      "password":"84738821"
   },
   27042354,
   "986307652533704548852455773225"
]
[
   {
      "class":"telemessage.web.services.StatusMessageResponse",
      "messageID":27042354,
      "messageKey":"986307652533704548852455773225",
      "recipients":[
         {
            "class":"telemessage.web.services.RecipientStatus",
            "description":"Message was not delivered yet",
            "recipient":{
               "addresType":0,
               "class":"telemessage.web.services.Recipient",
               "description":"Mrs. Jane Doe",
               "type":"SMS",
               "value":"1-212-5551337"
            },
            "status":0,
            "statusDate":1406553761000
         }
      ],
      "resultCode":0,
      "resultDescription":"Message was not delivered yet"
   }
]

See the following code example in Java of how to Post JSON to the TeleMessage REST gateway:

Note: we are using Apache HttpClient 4.3 in this example. 

        String json = "....your json here...";
        
        try {
            CloseableHttpClient httpclient = HttpClients.createDefault();
            HttpPost httppost = new HttpPost(tm.getSendURL(TeleMessage.Interface.JSON));
            StringEntity entity = new StringEntity(json, Charset.forName("UTF-8"));
            httppost.setEntity(entity);

            HttpResponse resp = httpclient.execute(httppost);
            if (resp != null && resp.getStatusLine().getStatusCode() == 200) {
                InputStream in = resp.getEntity().getContent();
                try {
                    // read and parse response from TeleMessage
                    ........................
                    ........................
                    ........................
                    ........................
                } finally { 
                   if (in != null) IOUtils.closeQuietly(in); 
                } 
             } 
        } catch (Exception e) { 
             e.printStackTrace(); 
        }