Skip to main content
Use messenger.inbound_message.received to handle this event at your webhook endpoint.

Triggers

Occurs when an ordinary Messenger text message is received from a customer. Subscribe to messenger.inbound_message.received when you configure your webhook endpoint. from is the customer’s Page-scoped ID (PSID), and to is the Facebook Page ID. These identifiers are not phone numbers. Preserve leading and trailing whitespace in text.body.

Syntax

YCloud sends an HTTP POST request to your configured webhook URL. The following shape shows one payload variant. Angle-bracket values are placeholders; their types are listed under Parameters. Optional fields and other variants are described below.

Parameters

Validate the YCloud-Signature HTTP header before you process the JSON body. See signature validation.

Event envelope

Event payload

The four common envelope fields are required. Payload fields depend on the event variant. In each object table, Required applies when its parent object is present. Optional fields can be omitted; a sample does not make a field required.

messengerInboundMessage

Example

The following JSON is the body delivered to your receiver. IDs, phone numbers, and other account values are illustrative. Use messengerInboundMessage.id to correlate repeated customer messages; preserve text whitespace.
After verifying the signature and durably accepting the event, return a 2xx response. Process slow work asynchronously.