Query a Message Status

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

StatusMessageResponsequeryStatus (AuthenticationDetailsloginDetails, long messageID, String messageKey)

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 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 Error & Status Codes).
resultDescription
String Textual explanation of result (see Error & Status Codes).
recipients
Array of RecipientStatus objects.  One or more RecipientStatus objects.

 

  •         try {
                Sender s = new SenderServiceLocator().gettelemessage();
                AuthenticationDetails a = 
                       new AuthenticationDetails("password","john_donne");
                // message id and message key received by sending message
                StatusMessageResponse sr = 
                       s.queryStatus(a, 353381235, "731815630040821905088475443869");
                System.out.println("result status: " + sr.getResultCode());
                if (sr.getResultCode() == 0 || sr.getResultCode() == 100) {
                    for (RecipientStatus rt : sr.getRecipients()) {
                        System.out.println("Date: " + (new Date(rt.getStatusDate())) + 
                              ", message status: " + rt.getStatus() + 
                              ", status description: " + rt.getDescription() + 
                              " for recipient " + rt.getRecipient().getValue());
                    }
                }
            } catch (ServiceException e) {
                e.printStackTrace();
            } catch (RemoteException e) {
                e.printStackTrace();
            }

    Explore additional code samples & developer resources: 
    JAVA LibraryPHP LibraryREST APIXML APIHTTP API, and more