Step 19 – Cara Menggunakan “HTTP API Integration – WhatsApp HTTP API” di AfterSale

Bahagian HTTP API Integration digunakan untuk menghubungkan AfterSale dengan sistem luaran (external systems) melalui API.

Modul ini sangat berguna jika anda:

  • Menggunakan WhatsApp API pihak ketiga
  • Mahu hantar mesej WhatsApp menggunakan custom API
  • Nak sambungkan AfterSale dengan server anda sendiri
  • Nak guna provider WhatsApp API seperti:
    • UltraMsg
    • WAAPI
    • Chat-API
    • Fonnte
    • Own WhatsApp Gateway
    • Custom self-hosted API

Modul ini memberi fleksibiliti maksimum untuk integrasi custom.


🧭 1. Pengenalan Antaramuka

Pada bahagian ini, anda akan nampak:

⭐ WhatsApp HTTP API

Blok ini membawa anda ke konfigurasi untuk sambungkan WhatsApp API custom anda.

Paparan minimal ini bermaksud:

  • Modul fokus hanya untuk Integrasi WhatsApp API
  • Semua konfigurasi berada di dalam modul WhatsApp API tersebut

🚀 2. Apa Itu “WhatsApp HTTP API”?

Ia adalah integrasi yang membolehkan anda:

  • Menghubungkan AfterSale dengan mana-mana WhatsApp API yang menyokong HTTP request
  • Menghantar mesej WhatsApp secara automatik melalui workflow, bot, blasting dan automation
  • Menggunakan endpoint API tersendiri (custom)

Dengan HTTP API, anda boleh kawal:

  • URL endpoint untuk menghantar mesej
  • Parameter mesej
  • Authorization token
  • Media attachments
  • Template mesej atau mesej bebas

Pendek kata, sambung AfterSale → ke WhatsApp API custom.


➕ 3. Cara Setup WhatsApp HTTP API

Langkah 1 — Klik “WhatsApp HTTP API”

Anda akan dibawa ke halaman konfigurasi API.

🔧 A. API Endpoint URL

Contoh:

https://api.ultramsg.com/instanceXXXX/messages

atau

https://yourserver.com/send-message

🔧 B. HTTP Method

– POST
– GET
(Setiap provider lain-lain)

🔧 C. Authorization

Contoh yang biasa:

api_key: xxxxxx

token: abcdef1234

Authorization: Bearer xxxxx

🔧 D. Body Parameters

Parameter biasa untuk hantar mesej WhatsApp:

ParameterFungsi
phone / toNombor telefon penerima
message / textKandungan mesej
typetext / image / document
media_urlURL gambar/dokumen
instance_idJika gunakan API gateway tertentu

Contoh payload:

{

  “to”: “60123456789”,

  “message”: “Hi, ini mesej dari AfterSale!”

}

🔧 E. Test Connection

Sesetengah sistem beri button Test.
Jika tidak, anda boleh test melalui workflow.


🛠 4. Contoh Setup Mengikut Provider

✔ UltraMsg

  • Method: POST
  • URL:
    https://api.ultramsg.com/{instance}/messages/chat
  • Params: to, body
  • Authorization: token

✔ Chat-API / WAAPI

  • Method: POST
  • URL:
    https://yourdomain/api/sendMessage
  • Params: phone, body

✔ Fonnte

  • Method: POST
  • URL:
    https://api.fonnte.com/send
  • Header: Authorization Token
  • Params: target, message

✔ Custom Server API

  • Method: GET/POST
  • Anda tentukan sendiri parameter

🟢 5. Menghubungkan WhatsApp HTTP API ke Bot / Automation

Setelah API disimpan:

📌 Anda boleh gunakan API ini untuk:

  • WhatsApp Blasting
  • ChatBot auto reply
  • Workflow automation (respond to events)
  • API triggers
  • Integration dengan E-commerce
  • Notification kepada pelanggan

Cara Integrasi:

  1. Pergi ke Bot Manager
  2. Pilih bot atau buat bot baru
  3. Pada bahagian Sender Settings
  4. Pilih WhatsApp HTTP API sebagai sender

Sekarang bot akan menghantar mesej melalui API custom yang anda tetapkan.


🔁 6. Kegunaan Lanjutan HTTP API

✔ Webhook Integration

Boleh sambungkan dari sistem luar → masuk ke AfterSale.

✔ Custom WhatsApp Notification

Contoh:

  • Bila orang isi Google Form
  • Bila ada order baru
  • Bila ada abandonment cart
  • Bila ada tiket support baru

✔ Advanced Automation

Menggunakan Workflow:

  • “When triggered → Send HTTP Request → Send WhatsApp”

✔ Use Case Dunia Sebenar

  • Sistem POS hantar mesej WhatsApp resit
  • CRM hantar appointment reminder
  • Marketplace order update
  • Sistem tempahan hantar e-ticket

⚠️ 7. Tips Penting Setup WhatsApp HTTP API

✔ Guna format nombor antarabangsa

Contoh Malaysia:

60123456789

✔ Jangan guna simbol +, -, ()

API biasanya tidak menerima simbol.

✔ Pastikan server API anda stabil

Jika server lambat → mesej delay.

✔ Pastikan SSL (https) aktif

Jika tidak, banyak API provider akan reject.

✔ Sahkan quota API provider anda

Jika quota habis → mesej tidak dihantar.


Leave a Reply 0

Your email address will not be published. Required fields are marked *