Advertising SMS API
This document guides you on how to use the API to send bulk advertising SMS messages.
- Method:
POST - Endpoint:
https://api.yoursales.vn/api/public/sms/send-ads - Authentication Required:
Authorization: Basic {API_KEY} - Content-Type:
application/json
📝 Description
This API allows you to send advertising messages to multiple phone numbers through a campaign with a pre-configured brandname.
🔐 Request Headers
| Name | Value | Required |
|---|---|---|
| Authorization | Basic {API_KEY} | ✅ |
| Content-Type | application/json | ✅ |
| Accept | application/json | ✅ |
📦 Request Body
{
"brand": "ABC_CORP",
"campaign_name": "April_Promo",
"msg": "April offer: 50% off all products!",
"list_phone": ["84901234567", "84907654321"],
"sent_time": "2024-04-26 10:00:00",
"client_campaign_id": "APR_PROMO_001"
}
| Field | Type | Description | Required |
|---|---|---|---|
| brand | string | Registered and activated brandname | ✅ |
| campaign_name | string | Advertising campaign name | ✅ |
| msg | string | Advertising message content | ✅ |
| list_phone | array | List of recipient phone numbers. Limit: 1,000,000 numbers | ✅ |
| sent_time | datetime | Scheduled send time (format Y-m-d H:i:s) | ✅ |
| client_campaign_id | string | Campaign ID from client | ❌ |
✅ Success Response
- HTTP Code:
201 Created
{
"message": "Success",
"data": {
"code": "e7c57cd5-77f9-4a45-9b51-4dce26de2199"
}
}
- Meaning: The campaign has been created and queued for processing.
❌ Error Response
- HTTP Code:
!= 201 Created
{
"message": "Brandname does not exist",
"error_code": "00010"
}
- Error code list: 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 '{
"brand": "ABC_CORP",
"campaign_name": "April_Promo",
"msg": "April offer: 50% off all products!",
"list_phone": ["84901234567", "84907654321"],
"sent_time": "2024-04-26 10:00:00",
"client_campaign_id": "APR_PROMO_001"
}'
📌 Notes
- Phone numbers must be in the correct Vietnamese format, starting with
84xor0xxand exactly 11 digits. - Brandname must be activated and linked to the API Key's customer.
- The campaign will be reviewed by the carrier.
API_KEYwill be provided when you create an account.