message_echoes Webhook Event ReferenceThis callback will occur when a message has been sent by your page. You may receive text messsages or messages with attachments (image, video, audio, template or fallback). The payload will also include an optional custom metadata sent by the sender, and the corresponding app_id.
You can subscribe to this callback by selecting the message_echoes field when setting up your webhook.
Multiple types of messages are supported:
{
"sender":{
"id":"<PAGE_ID>"
},
"recipient":{
"id":"<PSID>"
},
"timestamp":1457764197627,
"message":{
"is_echo":true,
"app_id":1517776481860111,
"metadata": "<DEVELOPER_DEFINED_METADATA_STRING>",
"mid":"mid.1457764197618:41d102a3e1ae206a38",
...
}
}
{
"object": "page",
"entry": [
{
"id": "<PAGE_ID>",
"time": 1570053170926,
"standby": [
{
"sender": {
"id": "<PAGE_ID>"
},
"recipient": {
"id": "<PSID>"
},
"timestamp": 1570053170673,
"message": {
"mid": "qT7ywaKpO9kkQR7Gv-nM8LIfLZDamVrALniheUYEDdHJXjDXEAyaS1xxONzb2Iv-DFzmTihfWJV012P5pK0AhQ",
"is_echo": true,
"app_id": <APPID>,
"attachments": [
{
"title": "",
"url": "https:\/\/www.facebook.com\/commerce\/update\/",
"type": "template",
"payload": {
"template_type": "media",
"elements": [
{
"media_type": "image",
"attachment_id": 2457235337685388
}
]
}
}
]
}
}
]
}
]
}
sendersender Field | Description |
|---|---|
| The ID for your Facebook Page |
recipientrecipient Field | Description |
|---|---|
| The Page-scoped ID for the person who received a message from your business |
message| Field Name | Type | Description |
|---|---|---|
| Boolean | Indicates the message sent from the page itself |
| String | ID of the app from which the message was sent. Starting Graph API |
| String | Custom string passed to the Send API as the |
| String | Message ID |
{
"sender":{
"id":"<PAGE_ID>"
},
"recipient":{
"id":"<PSID>"
},
"timestamp":1457764197627,
"message":{
"is_echo":true,
"app_id":1517776481860111,
"metadata": "<DEVELOPER_DEFINED_METADATA_STRING>",
"mid":"mid.1457764197618:41d102a3e1ae206a38",
"text":"hello, world!"
}
} message| Property | Type | Description |
|---|---|---|
| String | Text of message |
{
"sender":{
"id":"<PAGE_ID>"
},
"recipient":{
"id":"<PSID>"
},
"timestamp":1458696618268,
"message":{
"is_echo":true,
"app_id":1517776481860111,
"metadata": "<DEVELOPER_DEFINED_METADATA_STRING>",
"mid":"mid.1458696618141:b4ef9d19ec21086067",
"attachments":[
{
"type":"image",
"payload":{
"url":"<IMAGE_URL>"
}
}
]
}
} message.attachments| Properties | Type | Description |
|---|---|---|
| String | Type of attachment: |
| String | URL of attachment |
{
"sender":{
"id":"<PAGE_ID>"
},
"recipient":{
"id":"<PSID>"
},
"timestamp":1458696618268,
"message":{
"is_echo":true,
"app_id":1517776481860111,
"metadata": "<DEVELOPER_DEFINED_METADATA_STRING>",
"mid":"mid.1458696618141:b4ef9d19ec21086067",
"attachments":[
{
"type":"template",
"payload":{
"template_type":"button",
"buttons":[
{
"type":"web_url",
"url":"https:\/\/www.messenger.com\/",
"title":"Visit Messenger"
}
]
}
}
]
}
} message.attachments| Property | Type | Description |
|---|---|---|
| String |
|
| String | Template payload as described in the Send API Reference |
A fallback attachment is any attachment not currently recognized or supported by the Message Echo feature.
{
"sender":{
"id":"<PAGE_ID>"
},
"recipient":{
"id":"<PSID>"
},
"timestamp":1458696618268,
"message":{
"is_echo":true,
"app_id":1517776481860111,
"metadata": "<DEVELOPER_DEFINED_METADATA_STRING>",
"mid":"mid.1458696618141:b4ef9d19ec21086067",
"attachments":[
{
"title":"Legacy Attachment",
"url":"https:\/\/www.messenger.com\/",
"type":"fallback",
"payload":null
}
]
}
} message.attachments| Property | Type | Description |
|---|---|---|
| String |
|
| String | Title of attachment (optional) |
| String | URL of attachment (optional) |
| String | Payload of attachment (optional) |
Message with products echo webhook is only available on Graph API v8.0+
App will need to have catalog_management permission approved to receive product details in webhooks.
{
"sender":{
"id":"<PAGE_ID>"
},
"recipient":{
"id":"<PSID>"
},
"timestamp":1458696618268,
"message":{
"is_echo":true,
"app_id":1517776481860111,
"metadata": "<DEVELOPER_DEFINED_METADATA_STRING>",
"mid":"mid.1458696618141:b4ef9d19ec21086067",
"attachments":[
{
"type":"template",
"payload":{
"product":{
"elements":[ // multiple elements for Hscroll
{
"id":"<PRODUCT_ID>",
"retailer_id":"<EXTERNAL_ID>",
"image_url":"https://fb.cdn.com/sdsd",
"title":"Some product title",
"subtitle": "40",
},
{...},
]
}
]
}
}
]
}
} product.elements| Property | Type | Description |
|---|---|---|
| String | Product ID from product catalog |
| String | External ID that is associated with the Product. (ex: SKU/ Content ID) |
| String | URL of product image |
| String | Title of product |
| String | Subtitle of product |
A fallback attachment is any attachment not currently recognized or supported by the Message Echo feature.
{
"sender":{
"id":"<PAGE_ID>"
},
"recipient":{
"id":"<PSID>"
},
"timestamp":1458696618268,
"message":{
"is_echo":true,
"app_id":1517776481860111,
"metadata": "<DEVELOPER_DEFINED_METADATA_STRING>",
"mid":"mid.1458696618141:b4ef9d19ec21086067",
"reply_to": {
"mid": "QUOTED-MESSAGE-ID",
"is_self_reply" : false
}
}
} message.reply_to| Property | Type | Description |
|---|---|---|
| String | Reference to the message id that this message is replying to |
| Boolean | Indicates whether the message is a self reply or not. |