Skip to content

Cancel Scheduled Message

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

Method

DELETE

Endpoint URL

The xxxx.backendless.app is a subdomain assigned to your application. For more information see the Client-side Setup section of this documentation.

http://xxxx.backendless.app/messaging/<message-id>

where:

Argument                Description
<message-id> ID of the message to cancel.

Request headers

Content-Type: application/json  
user-token: optional value obtained as a result of the login operation.

where:

Argument                Description
Content-Type Must be set to application/json. This header is mandatory.
user-token Optional header. Contains a value returned by Backendless in a preceding user Login API call. If user-token is set in the request, the operation will be executed with the security policy associated with the currently logged in user. This means all the permissions and roles assigned to the user will be enforced by Backendless.

Request Body

None

Response Body

{  
  "status" : "failed" | "canceled",  
  "messageId": messageId  
}

Errors

When the server-side reports an error, it returns a JSON object in the following format:

{  
  "message":error-message,  
  "code":error-code  
}

The following errors may occur during the message cancellation API call:

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

Example

Important

Make sure to replace xxxx in the domain name in the sample request below to the one assigned to your application.

curl -X DELETE \  
-v https://xxxx.backendless.app/api/messaging/yyyyyy-yyyyy-yyyyy