Chuyển tới nội dung chính

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​

NameValueRequired
AuthorizationBasic {API_KEY}✅
Content-Typeapplication/json✅
Acceptapplication/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"
}
FieldTypeDescriptionRequired
brandstringRegistered and activated brandname✅
campaign_namestringAdvertising campaign name✅
msgstringAdvertising message content✅
list_phonearrayList of recipient phone numbers. Limit: 1,000,000 numbers✅
sent_timedatetimeScheduled send time (format Y-m-d H:i:s)✅
client_campaign_idstringCampaign 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 84x or 0xx and exactly 11 digits.
  • Brandname must be activated and linked to the API Key's customer.
  • The campaign will be reviewed by the carrier.
  • API_KEY will be provided when you create an account.