Ringkasan
Section titled “Ringkasan”Provider WhatsApp terintegrasi dengan WhatsApp Business API (melalui Meta). Provider ini mendukung:
- Pesan teks
- Template message
- Tombol interaktif
- List message
- Media (gambar, dokumen, audio, video)
- Berbagi lokasi
Prasyarat
Section titled “Prasyarat”- Akun Meta Business
- Akses WhatsApp Business API
- Nomor telepon yang terverifikasi
Penyiapan
Section titled “Penyiapan”-
Buat Meta App
Buka developers.facebook.com:
- Buat app baru (tipe Business)
- Tambahkan produk WhatsApp
- Siapkan WhatsApp Business API
-
Dapatkan Kredensial API
Di dashboard Meta app Anda:
- Buka WhatsApp → Getting Started
- Salin Phone Number ID
- Hasilkan dan salin Permanent Access Token
- Catat Business Account ID Anda
-
Konfigurasikan Webhook
Di WhatsApp → Configuration:
- Atur Callback URL:
https://your-domain.com/webhook/whatsapp/{tenant}/{team} - Atur Verify Token (string bebas pilihan Anda)
- Subscribe ke:
messages
- Atur Callback URL:
-
Konfigurasikan Provider
answers.json {"messaging-whatsapp": {"enabled": true,"public_base_url": "https://your-domain.ngrok-free.app","phone_number_id": "123456789012345","access_token": "EAAxxxxx...","verify_token": "your-verify-token","business_account_id": "987654321098765"}} -
Jalankan Setup
Terminal window gtc setup --answers answers.json ./my-bundle
Opsi Konfigurasi
Section titled “Opsi Konfigurasi”| Opsi | Wajib | Deskripsi |
|---|---|---|
enabled | Ya | Aktifkan/nonaktifkan provider |
public_base_url | Ya | URL publik untuk webhook |
phone_number_id | Ya | WhatsApp phone number ID |
access_token | Ya | Permanent access token |
verify_token | Ya | Webhook verification token |
business_account_id | Tidak | WhatsApp Business Account ID |
api_version | Tidak | Versi Graph API (default: v18.0) |
Pesan Teks
Section titled “Pesan Teks”- id: reply type: reply config: message: "Hello! How can I help you today?"Template Messages
Section titled “Template Messages”- id: send_template type: reply config: template: name: "order_confirmation" language: "en" components: - type: body parameters: - type: text text: "{{order_id}}" - type: text text: "{{customer_name}}"Tombol Interaktif
Section titled “Tombol Interaktif”- id: ask_action type: reply config: interactive: type: button body: text: "What would you like to do?" action: buttons: - type: reply reply: id: "help" title: "Get Help" - type: reply reply: id: "status" title: "Check Status" - type: reply reply: id: "human" title: "Talk to Human"List Messages
Section titled “List Messages”- id: show_menu type: reply config: interactive: type: list header: type: text text: "Support Menu" body: text: "Please select an option:" action: button: "View Options" sections: - title: "Support" rows: - id: "technical" title: "Technical Support" description: "Hardware and software issues" - id: "billing" title: "Billing" description: "Payment and invoices" - title: "Sales" rows: - id: "pricing" title: "Pricing" description: "Product pricing information"Kirim Gambar
Section titled “Kirim Gambar”- id: send_image type: reply config: media: type: image link: "https://example.com/product.jpg" caption: "Here's the product image"Kirim Dokumen
Section titled “Kirim Dokumen”- id: send_document type: reply config: media: type: document link: "https://example.com/invoice.pdf" filename: "invoice.pdf" caption: "Your invoice is attached"Kirim Lokasi
Section titled “Kirim Lokasi”- id: send_location type: reply config: location: latitude: 37.7749 longitude: -122.4194 name: "Our Office" address: "123 Main St, San Francisco, CA"Menangani Klik Tombol
Section titled “Menangani Klik Tombol”name: handle_buttonversion: "1.0"
nodes: - id: route_button type: branch config: conditions: - expression: "button.id == 'help'" next: show_help - expression: "button.id == 'status'" next: check_status - expression: "button.id == 'human'" next: escalate default: unknown
- id: show_help type: reply config: message: "Here's how I can help..."
triggers: - type: interactive target: route_buttonTemplate Message
Section titled “Template Message”Membuat Template
Section titled “Membuat Template”- Buka Meta Business Suite → WhatsApp Manager → Message Templates
- Buat template baru dengan komponen yang diperlukan
- Kirim untuk persetujuan (biasanya 24-48 jam)
Komponen Template
Section titled “Komponen Template”- id: send_notification type: reply config: template: name: "appointment_reminder" language: "en" components: - type: header parameters: - type: image image: link: "https://example.com/logo.png" - type: body parameters: - type: text text: "{{customer_name}}" - type: text text: "{{appointment_time}}" - type: button sub_type: quick_reply index: 0 parameters: - type: payload payload: "confirm"Jendela 24 Jam
Section titled “Jendela 24 Jam”Periksa Status Jendela
Section titled “Periksa Status Jendela”- id: check_window type: branch config: conditions: - expression: "last_message_time + 86400 > now" next: send_freeform default: send_template
- id: send_freeform type: reply config: message: "Thanks for your message!"
- id: send_template type: reply config: template: name: "follow_up" language: "en"Troubleshooting
Section titled “Troubleshooting”Verifikasi Webhook Gagal
Section titled “Verifikasi Webhook Gagal”- Verifikasi
verify_tokensesuai dengan konfigurasi - Periksa URL webhook dapat diakses secara publik
- Pastikan HTTPS dikonfigurasi dengan benar
Pesan Tidak Terkirim
Section titled “Pesan Tidak Terkirim”- Periksa format nomor telepon (sertakan kode negara)
- Verifikasi template sudah disetujui (jika menggunakan template)
- Periksa status jendela 24 jam
- Tinjau log webhook Meta
Rate Limiting
Section titled “Rate Limiting”WhatsApp memiliki batas rate berdasarkan quality rating:
- Tier 1: 1.000 pesan/hari
- Tier 2: 10.000 pesan/hari
- Tier 3: 100.000 pesan/hari
Tangani dengan baik:
- id: reply type: reply config: message: "Response" retry_on_rate_limit: trueKeamanan
Section titled “Keamanan”Greentic memvalidasi:
- Header X-Hub-Signature-256
- Hash payload dengan app secret
Praktik Terbaik
Section titled “Praktik Terbaik”- Gunakan template dengan bijak - Buat template yang serbaguna dan sudah disetujui
- Hormati jendela 24 jam - Lacak engagement pengguna
- Tangani opt-out - Hormati permintaan STOP/UNSUBSCRIBE
- Jaga pesan tetap ringkas - WhatsApp ditujukan untuk komunikasi cepat
- Gunakan media kaya - Gambar dan dokumen meningkatkan UX
Langkah Selanjutnya
Section titled “Langkah Selanjutnya”- Telegram Provider - Alternatif messaging
- Template Guidelines - Aturan template dari Meta
- Flows Guide - Bangun workflow yang kompleks