ประเภทข้อความ
Cascade API รองรับประเภทข้อความสี่ประเภท ซึ่งแต่ละประเภทได้รับการปรับให้เหมาะสมกับกรณีการใช้งานและช่องทางที่แตกต่างกัน.
ภาพรวม
| Type | Purpose | Channels | Interactive |
|---|---|---|---|
transaction | Critical notifications | All | No |
promo | Marketing campaigns | All | Yes (buttons) |
viber_survey | Polls and feedback | Viber, SMS | Yes (options) |
flashcall | Phone verification | Phone call | No |
Transaction Messages
Critical notifications like order confirmations, account updates, and system alerts.
Characteristics
- High priority delivery
- No promotional content
- Direct and concise
- Time-sensitive
- Routed through: Telegram → Viber → RCS → SMS
Use Cases
- Order confirmations
- Payment notifications
- Account alerts
- การแจ้งเตือนด้านความปลอดภัย
- การอัปเดตการจัดส่ง
- การรีเซ็ตรหัสผ่าน
ตัวอย่าง
{
"id": "tx-order-12345",
"fromName": "YourStore",
"toPhone": "+380XXXXXXXXX",
"messageType": "transaction",
"text": "Order #12345 confirmed. Total: $99.99. Delivery: Jan 25. Track: https://example.com/track/12345",
"ttl": 86400
}
แนวทางปฏิบัติที่ดีที่สุด
- ✅ เก็บข้อความให้มีความยาวไม่เกิน 160 ตัวอักษรเมื่อเป็นไปได้
- ✅ รวมรายละเอียดการทำธุรกรรมที่เกี่ยวข้อง
- ✅ ให้ลิงก์ติดตาม
- ✅ ใช้ภาษาที่ชัดเจนและเป็นมืออาชีพ
- ❌ อย่ารวมเนื้อหาการตลาด
- ❌ อย่าใช้ emoji มากเกินไป
ตัวอย่างตามกรณีการใช้งาน
การยืนยันคำสั่งซื้อ
{
"messageType": "transaction",
"text": "Order #12345 confirmed. Total: $99.99. Expected delivery: Jan 25."
}
การแจ้งการชำระเงิน
{
"messageType": "transaction",
"text": "Payment of $150.00 to Merchant ABC successful. Transaction ID: TXN789. Balance: $850.00"
}
การแจ้งเตือนด้านความปลอดภัย
{
"messageType": "transaction",
"text": "New login detected from iPhone at 10:30 AM. Location: New York. If this wasn't you, secure your account immediately."
}
การอัปเดตการจัดส่ง
{
"messageType": "transaction",
"text": "Your package is out for delivery! Expected arrival: 2-4 PM. Track: https://track.example.com/PKG123"
}
ข้อความโปรโมชั่น
แคมเปญการตลาดและโปรโมชั่นที่มีสื่อมัลติมีเดียและองค์ประกอบเชิงโต้ตอบ
ลักษณะ
- รองรับสื่อมัลติมีเดีย
- ปุ่มโต้ตอบ
- เน้นการกระตุ้นให้ทำการ
- ยอมรับ TTL ที่ยาวขึ้น
- ส่งต่อผ่าน: Telegram → Viber → RCS → SMS
กรณีการใช้งาน
- การเปิดตัวสินค้า
- ประกาศการขาย
- คำเชิญงานอีเวนต์
- แคมเปญจดหมายข่าว
- ข้อเสนอพิเศษ
- การสร้างการรับรู้แบรนด์
ตัวอย่าง
{
"id": "promo-summer-sale",
"fromName": "YourBrand",
"toPhone": "+380XXXXXXXXX",
"messageType": "promo",
"text": "🌟 Summer Sale! Up to 50% off on selected items. Shop now: https://example.com/sale",
"ttl": 259200
}
พร้อมตัวแปร
{
"messageType": "promo",
"text": "Hi %name=1%! Exclusive offer: Use code %name=2% for 20% off. Shop: %short_url=1%",
"variables": [
{"id": 1, "type": "name", "value": "John"},
{"id": 2, "type": "name", "value": "VIP20"},
{"id": 1, "type": "short_url", "value": "https://store.com/sale?utm=sms"}
]
}
แนวทางปฏิบัติที่ดีที่สุด
- ✅ รวมการกระตุ้นให้ทำการที่ชัดเจน
- ✅ ใช้ภาษาที่ดึงดูด
- ✅ เพิ่มพารามิเตอร์การติดตามใน URL
- ✅ ปรับให้เป็นส่วนตัวด้วยตัวแปร
- ✅ ทดสอบบนหลายช่องทาง
- ❌ อย่าสแปมลูกค้า
- ❌ อย่าใช้เนื้อหาที่ทำให้เข้าใจผิด
- ❌ อย่าเกินขีดจำกัดอักขระ
ตัวอย่างตามกรณีการใช้งาน
การเปิดตัวสินค้า
{
"messageType": "promo",
"text": "🎉 NEW ARRIVAL: iPhone 15 Pro now available! Pre-order today and get free shipping. Visit: https://store.com/iphone15"
}
การขายแฟลช
{
"messageType": "promo",
"text": "⚡ FLASH SALE: 2 hours only! Extra 30% off everything. Use code: FLASH30. Shop now: https://store.com/flash"
}
คำเชิญงานอีเวนต์
{
"messageType": "promo",
"text": "You're invited! VIP Shopping Event on Jan 25 at 6 PM. Exclusive deals + refreshments. RSVP: https://events.com/vip"
}
ตะกร้าทิ้ง
{
"messageType": "promo",
"text": "Hi %name=1%! You left items in your cart. Complete purchase now and get 10% off with code CART10: %short_url=1%"
}
แบบสำรวจ Viber
แบบสำรวจและโพลแบบโต้ตอบเพื่อเก็บความคิดเห็นของลูกค้า.
คุณลักษณะ
- ตัวเลือกการตอบ 2-5 รายการ
- ข้อความจำกัด 85 ตัวอักษร
- อินเทอร์เฟซโต้ตอบบน Viber
- ถอยกลับเป็น SMS (ไม่มีการโต้ตอบ)
- รูปแบบคำถามเดียว
กรณีการใช้งาน
- แบบสำรวจความพึงพอใจของลูกค้า
- ความคิดเห็นเกี่ยวกับสินค้า
- การให้คะแนนคุณภาพการบริการ
- การวิจัยตลาด
- การตอบรับเหตุการณ์
- Net Promoter Score (NPS)
ตัวอย่าง
{
"id": "survey-satisfaction-001",
"fromName": "YourBrand",
"toPhone": "+380XXXXXXXXX",
"messageType": "viber_survey",
"text": "How satisfied are you with our service?",
"surveyOptions": [
"Very Satisfied",
"Satisfied",
"Neutral",
"Dissatisfied",
"Very Dissatisfied"
],
"ttl": 604800
}
ข้อจำกัด
- Text: สูงสุด 85 ตัวอักษร
- Options: 2-5 ตัวเลือก
- Option Length: ไม่เกิน 30 ตัวอักษรต่อรายการ
- TTL: แนะนำ 7-30 วัน
แนวทางปฏิบัติที่ดีที่สุด
- ✅ ถามคำถามที่ชัดเจนหนึ่งข้อ
- ✅ ให้ตัวเลือกที่สมดุล
- ✅ ใช้ภาษาง่าย
- ✅ ทำให้ตัวเลือกกระชับ
- ✅ ตั้งค่า TTL ที่เหมาะสม (7+ วัน)
- ❌ อยาถามหลายคำถาม
- ❌ อย่าใช้ศัพท์เทคนิค
- ❌ อย่าให้การตอบมีอคติ
ตัวอย่างตามกรณีการใช้งาน
ความพึงพอใจของลูกค้า (NPS)
{
"messageType": "viber_survey",
"text": "How likely are you to recommend us to a friend?",
"surveyOptions": [
"0 - Not at all",
"1-6 - Unlikely",
"7-8 - Likely",
"9-10 - Very Likely"
]
}
ข้อเสนอแนะเกี่ยวกับผลิตภัณฑ์
{
"messageType": "viber_survey",
"text": "How do you rate our new product?",
"surveyOptions": [
"⭐️ Excellent",
"⭐️ Good",
"⭐️ Average",
"⭐️ Poor",
"⭐️ Very Poor"
]
}
คุณภาพการให้บริการ
{
"messageType": "viber_survey",
"text": "Was your support experience helpful?",
"surveyOptions": [
"Yes, very helpful",
"Somewhat helpful",
"Not helpful"
]
}
ข้อเสนอแนะเหตุการณ์
{
"messageType": "viber_survey",
"text": "Would you attend our events again?",
"surveyOptions": [
"Definitely yes",
"Probably yes",
"Not sure",
"Probably not",
"Definitely not"
]
}
แฟลชคอล
การยืนยันหมายเลขโทรศัพท์โดยใช้การโทรอัตโนมัติเบนท์การใช้รหัส SMS.
คุณลักษณะ
- การยืนยันที่คุ้มค่า
- เร็วกว่า SMS (1-3 วินาที)
- ไม่มีรหัสที่มองเห็นได้ในการแจ้งเตือน
- ทนต่อการโจมตีแบบเปลี่ยน SIM
- โทรศัพท์เท่านั้น (ไม่มี Telegram/Viber)
กรณีการใช้งาน
- การลงทะเบียนผู้ใช้
- การยืนยันการเข้าสู่ระบบ
- การตรวจสอบหมายเลขโทรศัพท์
- การยืนยันตัวตนสองขั้นตอน
- การกู้คืนบัญชี
- การยืนยันธุรกรรม
ตัวอย่าง
{
"id": "verify-user-12345",
"fromName": "YourApp",
"toPhone": "+380XXXXXXXXX",
"messageType": "flashcall",
"ttl": 300
}
วิธีการทำงาน
- ผู้ใช้ป้อนหมายเลขโทรศัพท์
- API เริ่มการโทรแบบแฟลช
- การโทรสิ้นสุดหลังจาก 1-2 สาย
- แอปจับรหัสผู้โทร
- รหัสผู้โทรตรวจสอบกับรูปแบบ
- ผู้ใช้ได้รับการยืนยันตัวตน
แนวทางปฏิบัติที่ดีที่สุด
- ✅ ตั้งค่า TTL สั้น (60-300 วินาที)
- ✅ ใช้การตรวจจับรหัสผู้โทร
- ✅ ให้บริการสำรอง SMS
- ✅ จัดการคำขอสิทธิ์
- ✅ แสดงคำแนะนำที่ชัดเจน
- ❌ อย่าใช้เพื่อวัตถุประสงค์ส่งเสริมการขาย
- ❌ อย่าตั้งค่า TTL ยาว
ตัวอย่างพร้อมสำรอง
{
"id": "verify-001",
"fromName": "YourApp",
"toPhone": "+380XXXXXXXXX",
"messageType": "flashcall",
"ttl": 300,
"fallback": {
"messageType": "transaction",
"text": "Your verification code: 123456"
}
}
การเลือกประเภทที่เหมาะสม
แผนผังการตัดสินใจ
Is it time-critical or transactional?
├─ Yes → transaction
└─ No
└─ Is it promotional?
├─ Yes → promo
└─ No
└─ Is it a survey?
├─ Yes → viber_survey
└─ No → Is it for verification?
├─ Yes → flashcall
└─ No → transaction (default)
ตารางเปรียบเทียบ
| คุณลักษณะ | ธุรกรรม | โปรโมชั่น | สำรวจ | การโทรแบบแฟลช |
|---|---|---|---|---|
| สื่อหลากหลาย | ❌ | ✅ | ❌ | ❌ |
| โต้ตอบ | ❌ | ✅ | ✅ | ❌ |
| การปรับแต่ง | ✅ | ✅ | ✅ | ❌ |
| TTL ปกติ | ชั่วโมง | วัน | สัปดาห์ | นาที |
| ค่าใช้จ่าย | ปานกลาง | ปานกลาง | ปานกลาง | ต่ำ |
| ความเร็วการส่ง | เร็ว | เร็ว | เร็ว | เร็วที่สุด |
ตัวอย่างการใช้งาน
class CascadeMessageBuilder {
constructor(apiKey) {
this.apiKey = apiKey;
}
buildTransaction(id, fromName, toPhone, text, ttl = 86400) {
return {
id,
fromName,
toPhone,
messageType: 'transaction',
text,
ttl
};
}
buildPromo(id, fromName, toPhone, text, ttl = 259200) {
return {
id,
fromName,
toPhone,
messageType: 'promo',
text,
ttl
};
}
buildSurvey(id, fromName, toPhone, text, options, ttl = 604800) {
if (text.length > 85) {
throw new Error('Survey text must be under 85 characters');
}
if (options.length < 2 || options.length > 5) {
throw new Error('Survey must have 2-5 options');
}
return {
id,
fromName,
toPhone,
messageType: 'viber_survey',
text,
surveyOptions: options,
ttl
};
}
buildFlashCall(id, fromName, toPhone, ttl = 300) {
return {
id,
fromName,
toPhone,
messageType: 'flashcall',
ttl
};
}
async send(message) {
// Implementation to send message
}
}
// Usage
const builder = new CascadeMessageBuilder('your-api-key');
// Transaction
const transaction = builder.buildTransaction(
'order-123',
'Store',
'+380XXXXXXXXX',
'Order confirmed'
);
// Promo
const promo = builder.buildPromo(
'promo-001',
'Brand',
'+380XXXXXXXXX',
'Sale now on!'
);
// Survey
const survey = builder.buildSurvey(
'survey-001',
'Brand',
'+380XXXXXXXXX',
'Rate our service?',
['Excellent', 'Good', 'Average', 'Poor']
);
// Flash Call
const flashCall = builder.buildFlashCall(
'verify-001',
'App',
'+380XXXXXXXXX'
);
ขั้นตอนต่อไป
- ส่งข้อความ - เริ่มส่งข้อความแบบ cascade
- ตัวแปรข้อความ - ปรับแต่งข้อความ
- SMSBAT API - สำรวจคุณสมบัติของ SMSBAT