message.inbound
Dikirim ketika pelanggan mengirim pesan ke nomor WhatsApp bisnis Anda. Ini termasuk pesan teks, gambar, dokumen, audio, video, stiker, lokasi, kontak, reaksi, dan pesan interaktif (tombol, daftar).
Contoh Payload
Section titled “Contoh Payload”Pesan Teks Masuk
Section titled “Pesan Teks Masuk”{ "object": "whatsapp_business_account", "entry": [ { "id": "1234567890", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "6281234567890", "phone_number_id": "9876543210" }, "contacts": [ { "profile": { "name": "Budi Santoso" }, "wa_id": "6289876543210" } ], "messages": [ { "from": "6289876543210", "id": "msg_f1e2d3c4-b5a6-7890-abcd-ef1234567890", "timestamp": "1717200200", "type": "text", "text": { "body": "Halo, saya ingin bertanya tentang produk Anda." } } ] }, "field": "messages" } ] } ]}Pesan Balasan (Reply)
Section titled “Pesan Balasan (Reply)”{ "object": "whatsapp_business_account", "entry": [ { "id": "1234567890", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "6281234567890", "phone_number_id": "9876543210" }, "contacts": [ { "profile": { "name": "Budi Santoso" }, "wa_id": "6289876543210" } ], "messages": [ { "from": "6289876543210", "id": "msg_f1e2d3c4-b5a6-7890-abcd-ef1234567890", "timestamp": "1717200250", "type": "text", "text": { "body": "Saya tertarik dengan produk ini" }, "context": { "id": "msg_a1b2c3d4-e5f6-7890-abcd-ef1234567890", "from": "6281234567890" } } ] }, "field": "messages" } ] } ]}Pesan Interaktif (Tombol)
Section titled “Pesan Interaktif (Tombol)”{ "object": "whatsapp_business_account", "entry": [ { "id": "1234567890", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "6281234567890", "phone_number_id": "9876543210" }, "contacts": [ { "profile": { "name": "Budi Santoso" }, "wa_id": "6289876543210" } ], "messages": [ { "from": "6289876543210", "id": "msg_f1e2d3c4-b5a6-7890-abcd-ef1234567890", "timestamp": "1717200300", "type": "interactive", "interactive": { "type": "button_reply", "button_reply": { "id": "btn_confirm", "title": "Konfirmasi" } } } ] }, "field": "messages" } ] } ]}contacts[] (Info Kontak)
Section titled “contacts[] (Info Kontak)”| Field | Tipe | Keterangan |
|---|---|---|
profile.name | string | Nama WhatsApp pengirim |
wa_id | string | Nomor WhatsApp pengirim (format E.164 tanpa +) |
messages[] (Detail Pesan)
Section titled “messages[] (Detail Pesan)”| Field | Tipe | Keterangan |
|---|---|---|
from | string | Nomor telepon pengirim |
id | string | ID pesan masuk (msg_{uuid}) |
timestamp | string | Unix timestamp penerimaan pesan |
type | string | Tipe pesan: text, image, document, audio, video, sticker, location, contacts, interactive, reaction, button, dll |
text.body | string | Isi pesan teks (hanya jika type = "text") |
context.id | string | ID pesan yang dibalas (jika ini adalah reply). Sudah ditukar ke format msg_{uuid} agar bisa dicocokkan dengan pesan yang Anda kirim |
context.from | string | Nomor telepon pengirim pesan asli |
Tipe Pesan Lainnya
Section titled “Tipe Pesan Lainnya”Setiap tipe pesan memiliki field khusus di dalam messages[]:
| Tipe | Field | Keterangan |
|---|---|---|
image | image.id, image.caption, image.mime_type | Gambar dengan caption opsional |
document | document.id, document.filename, document.mime_type | Dokumen/file |
audio | audio.id, audio.mime_type | Pesan suara atau audio |
video | video.id, video.caption, video.mime_type | Video |
sticker | sticker.id, sticker.mime_type | Stiker |
location | location.latitude, location.longitude, location.name, location.address | Lokasi |
contacts | contacts[].name, contacts[].phones[] | Kartu kontak |
interactive | interactive.type, interactive.button_reply / interactive.list_reply | Respon tombol atau daftar |
reaction | reaction.message_id, reaction.emoji | Reaksi emoji pada pesan |
Kapan Event Ini Dikirim?
Section titled “Kapan Event Ini Dikirim?”Event message.inbound dikirim ketika:
- Pelanggan mengirim pesan baru ke nomor bisnis Anda
- Pelanggan membalas pesan yang sebelumnya Anda kirim
- Pelanggan mengirim lokasi, kontak, atau media lainnya
Catatan
Section titled “Catatan”context.idpada pesan balasan sudah ditukar dari Meta wamid ke ID pesan platform (msg_{uuid}), sehingga Anda bisa langsung mencocokkan dengan ID yang dikembalikan oleh API pengiriman.- Jika akun Anda mengaktifkan
inbound_disabled, eventmessage.inboundtidak akan dikirim. - Jika akun Anda mengaktifkan
skip_media_ingestion, media pada pesan masuk tidak akan diunduh oleh platform. - Pesan masuk dari nomor yang belum ada di database kontak akan otomatis membuat entri kontak baru.
- Jika Anda mengirim
custom_propertiessaat mengirim pesan, properti tersebut akan muncul di fieldcustom_propertiespada payload inbound ketika pelanggan membalas pesan tersebut.