Cancel Campaign
This API is used to cancel a scheduled SMS or MMS campaign using the Cellcast API.
Parameters for Cancel Campaign API
Headers Parameters
| Parameters | Description |
|---|---|
| Authorization | Please add provided Bearer token - linked to your Cellcast account. Check here |
Request Body Parameters
| Name | Example | Description |
|---|---|---|
| messageId | 675161d8a000000000000000 | Required field. The unique identifier of the scheduled message to cancel. |
| type | sms | Required field. The type of message to cancel. Allowed values: sms, mms |
Code Samples
Post https://api.cellcast.com/api/v1/gateway/cancelScheduleQuickMessage
bash
curl --location 'https://api.cellcast.com/api/v1/gateway/cancelScheduleQuickMessage' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{API_KEY}}' \
--data '{
"messageId": "675161d8a000000000000000",
"type": "sms"
}'js
const axios = require("axios");
const cancelCampaign = async () => {
try {
const response = await axios.post(
"https://api.cellcast.com/api/v1/gateway/cancelScheduleQuickMessage",
{
messageId: "675161d8a000000000000000",
type: "sms"
},
{
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: "Bearer {{API_KEY}}",
},
}
);
console.log(response.data);
} catch (error) {
console.error(error.response.data);
}
};Replace with the actual API key that you own.
Responses
200 Success
json
{
"app_type": "web",
"app_version": "1.0",
"maintainence": 0,
"new_version": 0,
"force_update": 0,
"invalid_token": 0,
"refresh_token": "",
"show_message": 0,
"is_enc": false,
"status": true,
"message": "Job Removed successfully",
"message_type": "toast",
"data": {
"message": "Job Removed successfully"
},
"error": {}
}400 Bad Request
json
{
"code": 400,
"message": "messageId is required",
"stack": "APIError: messageId is required."
}401 Unauthorized
json
{
"code": 401,
"message": "Token expired",
"stack": "APIError: Token expired ...."
}