Skip to content

Cancel Scheduled Message

Delayed delivery as well as repeated publish messages can be canceled using the API documented below:


Future<MessageStatus> Backendless.messaging.cancel(String messageId);


Argument                Description
messageId ID of the message to cancel. Message ID must be obtained from the MessageStatus object obtained as the result of the Publish methods.        

Return value

Argument                Description
MessageStatus contains the ID of a message and its status. If the cancellation is successful, the getStatus() method on the MessageStatus object returns the value of PublishStatusEnum.CANCELED).


The following errors may occur during the message cancellation API call. See the Error Handling section for details on how to retrieve the error code when the server returns an error:

Error Code
Message has already been canceled or does not exist.


String messageId = // message id can be obtained from the MessageStatus object
                // received in the result of the publishing API