whatsapp.message.received
A customer sent a WhatsApp message to one of your numbers.
When it fires
A customer sent a message to one of your project's WhatsApp numbers: text, media, a location, contacts, a button tap, a list choice, a reaction, or another message type. It fires once per message.
A message with a file fires once the file is stored, so the file's status is ready and you can download it at once. If WhatsApp no longer has the file, or it can't be downloaded after retries for up to 24 hours, the event fires with the status unavailable instead. Every received message fires the event.
Event fields
data.idstringMessage ID, starting with
msg_. Use it to retrieve, mark as read, or reply to the message.data.senderstringThe customer, in E.164 format, or WhatsApp's user ID for the customer when WhatsApp doesn't share their number.
data.recipientstringYour number that received the message, in E.164 format.
data.typestringThe message's content is in the field of the same name.
One of
"text""image""video""audio""document""sticker""location""contacts""interactive""button""reaction""unsupported"data.reply_tostring or nullID of the message the customer replied to, or
null. Alsonullwhen that message was deleted after 30 days. A reaction names its message inreaction.message_idinstead.data.contactobjectThe customer's WhatsApp profile:
name, ornullwhen WhatsApp didn't share it.data.occurred_atstringISO 8601 time the customer sent the message, as reported by WhatsApp.
data.referralobjectOnly on a message sent from a Click-to-WhatsApp ad or post: the ad or post the customer came from.
The content field, such as data.text or data.image, has the same shape as in the message object. Files are described, never linked: download them with Get message media.
Handle this event
Store the message, then act on it: answer the customer, route the conversation, or record the button or list choice. A received message opens the customer service window for 24 hours from data.occurred_at, so you can reply with any message type, quoting it with reply_to.
Message content is personal data. Reading it later with the API needs a key with whatsapp.full_access, and Nexiom Connect keeps it, and its files, for 30 days: download what you need to keep.
Verify the signature before reading the payload. Delivery is at least once: deduplicate by the envelope id. Messages can arrive out of order; sort them by data.occurred_at.