{ "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 } ] } } ] } } ] } ] }
sender
sender 字段 | 描述 |
---|---|
| 您的 Facebook 公共主页编号 |
recipient
recipient 字段 | 描述 |
---|---|
| 收到您公司消息的用户的公共主页范围编号 |
message
字段名称 | 类型 | 描述 |
---|---|---|
| 布尔值 | 表示该消息由公共主页自行发送 |
| 字符串 | 发送消息的应用的编号。自图谱 API |
| 字符串 | 作为 |
| 字符串 | 消息编号 |
{ "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
属性 | 类型 | 描述 |
---|---|---|
| 字符串 | 消息文本 |
{ "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
属性 | 类型 | 描述 |
---|---|---|
| 字符串 | 附件类型: |
| 字符串 | 附件的网址 |
{ "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
属性 | 类型 | 描述 |
---|---|---|
| 字符串 |
|
| 字符串 | Send API 参考文档中所述的模板负载 |
回退附件是指消息返回功能目前无法识别或不支持的附件。
{ "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
属性 | 类型 | 描述 |
---|---|---|
| 字符串 |
|
| 字符串 | 附件标题(非必填) |
| 字符串 | 附件网址(非必填) |
| 字符串 | 附件负载(非必填) |
包含商品的消息返回 Webhooks 仅适用于图谱 API 8.0 及以上版本
应用将需要具备 catalog_management
权限,才能获准在 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
属性 | 类型 | 描述 |
---|---|---|
| 字符串 | 商品目录上的商品编号 |
| 字符串 | 与商品关联的外部编号。(例如:SKU 或内容编号) |
| 字符串 | 商品图像网址 |
| 字符串 | 商品标题 |
| 字符串 | 商品的副标题 |