NAV

Message(Last Updated : 01/11/2017)

Sent Message Result

A MessageCompositionResult object with the following fields is returned as a response to a successful call:

Fields

Method Name Data Returned Description
getRequestId(): String Request ID The key for the specific request.
getPushId(): long Push ID The key for the specific push message.
getMessageId(): long Message ID The message's unique ID number.
getStatus(): MessageCompositionResult.Status Status Status of the message (sent/sending/scheduled/canceled).
getEmailStatus(): MessageCompositionResult.DeliveryStatus Email delivery status Status of the sent email message.
getSmsStatus(): MessageCompositionResult.MobileDeliveryStatus SMS delivery status Status of the sent SMS message.
getMmsStatus(): MessageCompositionResult.MobileDeliveryStatus MMS delivery status Status of the sent MMS message.
getUsedCredit(): MessageCompositionResult.UsedCreditInfo Used credit The amount of domestic/international credits used for the message.
getDeliveryReport(): MessageCompositionResult.DeliveryReport Delivery report The report of the sent message showing its success or failure.

A MessageCompositionFailure object with the following fields is returned as a response to a failure call:

Fields

Method Name Data Returned Description
getRequestId(): String Request ID The key for the specific request.
getPushId(): long Push ID The key for the specific push message.
getStatusCode(): String API Status Code A code that provides additional information about the status of your request. Please reference the Status_code list for details.
getErrorData(): List<String> Error data Details for data that caused the error in the request.

The following example demonstrates how handlers are registered:

ApiResultListener<MessageCompositionResult, MessageCompositionFailure> listener = new ApiResultListener<MessageCompositionResult, MessageCompositionFailure>() { @Override public void onSuccess(@Nonnull MessageCompositionResult result) { // Handle success result } @Override public void onFailure(@Nonnull MessageCompositionFailure failure) { // Handle failure result } }; ResultHandler resultHandler = new ResultHandler.Builder() .listen(ApiResultTypeSpec.messageComposition, listener) .build(typeSpecFinder);

Cancel Scheduled Message Result

A ScheduledMessageCancellationResult object with the following fields is returned as a response to a successful call:

Fields

Method Name Data Returned Description
getRequestId(): String Request ID The key for the specific request.
getPushId(): long Push ID The key for the specific push message.
getSubscriptionId(): long Message ID The message’s unique ID number.

A BasicFailure object with the following fields is returned as a response to a failure call:

Fields

Method Name Data Returned Description
getRequestId(): String Request ID The key for the specific request.
getPushId(): long Push ID The key for the specific push message.
getStatusCode(): String API Status Code A code that provides additional information about the status of your request. Please reference the Status_code list for details.

The following example demonstrates how handlers are registered:

ApiResultListener<ScheduledMessageCancellationResult, BasicFailure> listener = new ApiResultListener<ScheduledMessageCancellationResult, BasicFailure>() { @Override public void onSuccess(@Nonnull ScheduledMessageCancellationResult result) { // Handle success result } @Override public void onFailure(@Nonnull BasicFailure failure) { // Handle failure result } }; ResultHandler resultHandler = new ResultHandler.Builder() .listen(ApiResultTypeSpec.scheduledMessageCancellation, listener) .build(typeSpecFinder);