Cancel a campaign
Overview
Stop a campaign. No further messages are sent.
Use this to halt a campaign that's running or scheduled.
You'll need the campaign_id.
The campaign's status becomes cancelled. Messages already sent are unaffected. A location's default campaign can't be cancelled.
Prerequisites
- A bearer token. See Authentication.
- The campaign's id (
campaignId).
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/campaign/{campaignId}/cancel
Authentication
Account token
- The campaign must belong to your own account. If it doesn't, the call returns
400(You are not authorized to cancel this campaign).
Rate limit
This endpoint has no rate limit.
Request parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
campaignId | path | integer | Yes | The id of the campaign to cancel. Digits only. |
Request body
None.
Request payload
None.
Response body
The payload is inside data.
| Field | Type | Description |
|---|---|---|
status | string | success. |
message | string | Campaign cancelled successfully. |
Response payload
{
"data": {
"status": "success",
"message": "Campaign cancelled successfully"
}
}Examples
Success payload
See Response payload.
Error payload
400 Campaign outside your account
{
"message": "Bad Request",
"status": "error",
"errors": "You are not authorized to cancel this campaign"
}400 Default campaign
{
"message": "Bad Request",
"status": "error",
"errors": "You cannot cancel the default campaign"
}422 Unknown campaign
{
"message": "The selected id is invalid.",
"errors": {
"id": [
"The selected id is invalid."
]
}
}| Status | Meaning |
|---|---|
200 | The campaign is cancelled. |
400 | The campaign belongs to another account, or it is the location's default campaign. |
401 | The token is missing, expired or invalid. |
422 | No campaign has that id. |
500 | Unexpected server error. |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/campaign/4823/cancel" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json'Updated 17 days ago
Did this page help you?
