Cancel Advertising Message API
This document guides you on how to use the API to cancel advertising messages.
- Method:
PUT - Endpoint:
https://api.yoursales.vn/api/public/sms/cancel-ads - Authentication Required:
Authorization: Basic {API_KEY} - Content-Type:
application/json
📝 Description
This API allows you to cancel advertising messages.
🔐 Request Headers
| Name | Value | Required |
|---|---|---|
| Authorization | Basic {API_KEY} | ✅ |
| Content-Type | application/json | ✅ |
| Accept | application/json | ✅ |
📦 Request Body
{
"campaign_code": "4b85fec5-537e-483f-b23b-3ce251bcc280"
}
| Field | Type | Description | Required |
|---|---|---|---|
| campaign_code | string | Campaign code | ✅ |
✅ Successful Response
- HTTP Code:
200 OK
{
"message": "Success",
"data": {
"code": "e7c57cd5-77f9-4a45-9b51-4dce26de2199"
}
}
- Meaning: The campaign has been successfully canceled.
❌ Failed Response
- HTTP Code:
!= 200 OK
{
"message": "Campaign cannot be canceled",
"error_code": "00010"
}
- List of error codes: Here
💻 CURL Example
curl -X POST https://your-domain.com/api/v1/sms/ads/send \
-H "Authorization: Basic YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"campaign_code": "e7c57cd5-77f9-4a45-9b51-4dce26de2199"
}'
📌 Notes
- In case the message is still stored in the system (not yet forwarded to the carrier). If the message has been processed or sent, cancellation cannot be performed. In that case, please contact us directly for further support.
API_KEYwill be provided when you create an account.