Lewati ke konten

WhatsApp

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
  • Akun Meta Business
  • Akses WhatsApp Business API
  • Nomor telepon yang terverifikasi
  1. Buat Meta App

    Buka developers.facebook.com:

    • Buat app baru (tipe Business)
    • Tambahkan produk WhatsApp
    • Siapkan WhatsApp Business API
  2. 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
  3. 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
  4. 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"
    }
    }
  5. Jalankan Setup

    Terminal window
    gtc setup --answers answers.json ./my-bundle
OpsiWajibDeskripsi
enabledYaAktifkan/nonaktifkan provider
public_base_urlYaURL publik untuk webhook
phone_number_idYaWhatsApp phone number ID
access_tokenYaPermanent access token
verify_tokenYaWebhook verification token
business_account_idTidakWhatsApp Business Account ID
api_versionTidakVersi Graph API (default: v18.0)
- id: reply
type: reply
config:
message: "Hello! How can I help you today?"
- 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}}"
- 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"
- 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"
- id: send_image
type: reply
config:
media:
type: image
link: "https://example.com/product.jpg"
caption: "Here's the product image"
- id: send_document
type: reply
config:
media:
type: document
link: "https://example.com/invoice.pdf"
filename: "invoice.pdf"
caption: "Your invoice is attached"
- id: send_location
type: reply
config:
location:
latitude: 37.7749
longitude: -122.4194
name: "Our Office"
address: "123 Main St, San Francisco, CA"
flows/on_button.ygtc
name: handle_button
version: "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_button
  1. Buka Meta Business Suite → WhatsApp Manager → Message Templates
  2. Buat template baru dengan komponen yang diperlukan
  3. Kirim untuk persetujuan (biasanya 24-48 jam)
- 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"
- 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"
  1. Verifikasi verify_token sesuai dengan konfigurasi
  2. Periksa URL webhook dapat diakses secara publik
  3. Pastikan HTTPS dikonfigurasi dengan benar
  • Periksa format nomor telepon (sertakan kode negara)
  • Verifikasi template sudah disetujui (jika menggunakan template)
  • Periksa status jendela 24 jam
  • Tinjau log webhook Meta

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: true

Greentic memvalidasi:

  • Header X-Hub-Signature-256
  • Hash payload dengan app secret
  1. Gunakan template dengan bijak - Buat template yang serbaguna dan sudah disetujui
  2. Hormati jendela 24 jam - Lacak engagement pengguna
  3. Tangani opt-out - Hormati permintaan STOP/UNSUBSCRIBE
  4. Jaga pesan tetap ringkas - WhatsApp ditujukan untuk komunikasi cepat
  5. Gunakan media kaya - Gambar dan dokumen meningkatkan UX