Skip to content

Cancel Scheduled Message

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

Method

DELETE

URL

http://api.backendless.com/<application-id>/<REST-api-key>/messaging/<message-id>

where:

Argument                Description
<application-id> the ID of your application generated upon its creation. You can get the value in the Manage > App Settings section of the Backendless Console.
<REST-api-key> REST API key of your application. You can get the value from the Manage > App Settings section of the Backendless Console.
<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

curl -X DELETE \  
-v https://api.backendless.com/APP-ID/REST-API-KEY/messaging/yyyyyy-yyyyy-yyyyy