通过 Webhooks,您可以接收 Meta 社交关系图谱中特定对象变更的实时 HTTP 通知。例如,当客户向您的 Instagram 专业账户发送消息时,我们会向您发送通知。Webhooks 通知可帮助您追踪消息变更,避免在为追踪变更而查询 Messenger 开放平台端点时造成流量限制。
您需要实现以下要求,才能接收 Instagram 消息的 Webhooks 通知。
instagram_basic
、instagram_manage_messages
和 pages_manage_metadata
权限注意:您需要为企业的所有消息应用订阅消息 Webhooks。
Webhooks 字段 | 描述 |
---|---|
| 当客户对消息留下或撤销心情时,系统会发出一条通知 图谱 API v12.0 和更高版本支持 |
| 当客户向您的企业发送以下消息时,系统会发出一条通知:
当您的企业向客户发送消息时,系统也会发送一条通知。当您的企业对客户消息留下心情或未留下心情时,不会发送通知。 系统将在您的 Instagram 账户发出消息时发起此回调。系统会显示 |
| 当客户点击“趣味问题”选项或“常规模板”按钮时,系统会发送一条通知 需要 v8.0 或更高版本。需要 v11.0 或更高版本,才能加入 |
| 收信人阅读消息后,系统会发送一条通知 |
| 当客户在已有对话中点击包含推荐参数的 |
| 若消息流包含多个应用,当客户向您的企业发送消息时,应用未在消息发出时控制对话,此时系统会发送一条通知。 |
以下是您可以接收的 Webhooks 通知类型的示例。
{ "object": "instagram", "entry": [ { "id": "IGID", // ID of your Instagram Professional account "time": 1569262486134, "messaging": [ { "sender": { "id": "IGSID" }, // Instagram-scoped ID for the customer who sent the message "recipient": { "id": "IGID" }, // ID of your Instagram Professional account "timestamp": 1569262485349, "message": { "mid": "MESSAGE-ID", // ID of the message sent to your business "text": "MESSAGE-TEXT" // Included when a customer sends a message containing text "attachments": [ // Included when a customer sends multiple media attachments or a URL for a story mention or share { "type":"image", // Can be audio, file, image (image or sticker), share, story_mention, video, ig_reel or reel "payload":{ "url":"LINK" } }, { "type":"video", "payload":{ "url":"LINK" } } ] "is_deleted": true // Included when a customer deletes a message "is_echo": true // Included when your business sends a message to the customer "is_unsupported": true, // Included when a customer sends a message with unsupported media "quick_reply": { // Included when a customer clicks a quick reply "payload": "CUSTOMER-RESPONSE-PAYLOAD" // The payload with the option selected by the customer }, "referral": { // Included when a customer clicks an Instagram Shop product "product": { "id": "PRODUCT-ID" } "referral": { // Included when a customer clicks an CTD ad "ref": "REF-DATA-IN-AD-IF-SPECIFIED" "ad_id": AD-ID, "source": "ADS", "type": "OPEN_THREAD", "ads_context_data": { "ad_title": TITLE-FOR-THE-AD, "photo_url": IMAGE-URL-THAT-WAS-CLICKED, "video_url": THUMBNAIL-URL-FOR-THE-AD-VIDEO, } } "reply_to":{ // Included when a customer sends an inline reply "mid":"MESSAGE-ID" } "reply_to": { // Included when a customer replies to a story "story": { "url":"CDN-URL", "id":"STORY-ID" } } } } ] } ] }
{ "object": "instagram", "entry": [ { "id": "IGID", // ID for your Instagram Professional account "time": 1569262486134, "messaging": [ { "sender": { "id": "IGSID" // Instagram-scoped ID for the customer who sent the message }, "recipient": { "id": "IGID" // ID for your Instagram Professional account }, "timestamp": 1569262485349, "reaction" :{ "mid" : "MESSAGE-ID", "action": "react", // or unreact "reaction": "love", // optional, to unreact if there is no reaction field "emoji": "\u{2764}\u{FE0F}" // optional, to unreact if there is no emoji field } } ] } ] }
{ "object": "instagram", "entry": [ { "id": "IGSID", // ID of your Instagram Professional account "time": 1502905976963, "messaging": [ { "sender": { "id": "IGSID" }, // Instagram-scoped ID for the customer who sent the message "recipient": { "id": "IGID" }, // ID of your Instagram Professional account "timestamp": 1502905976377, "postback": { "mid":"MESSAGE-ID", // ID for the message sent to your business "title": "SELECTED-ICEBREAKER-REPLY-OR-CTA-BUTTON", "payload": "CUSTOMER-RESPONSE-PAYLOAD", // The payload with the option selected by the customer } } ] } ] }
{ "object": "instagram", "entry": [ { "id": "IGSID", // ID of your Instagram Professional account "time": 1502905976963, "messaging": [ { "sender": { "id": "IGSID" // Instagram-scoped ID for the customer who sent the message }, "recipient": { "id": "IGID" // ID of your Instagram Professional account }, "timestamp": 1502905976377, "referral": { "ref": "INFORMATION-INCLUDED-IN-REF-PARAMETER-OF-IGME-LINK" "source": "IGME-SOURCE-LINK" "type": "OPEN_THREAD" // Only supported for existing conversations } } ] } ] }
{ "object":"instagram", "entry":[ { "id":"IGID", // ID for your Instagram Professional account "time":1569262486134, "messaging":[ { "sender":{ "id":"IGSID" // Instagram-scoped ID for the customer who sent the message }, "recipient":{ "id":"IGID" // ID for your Instagram Professional account }, "timestamp":1569262485349, "read":{ "mid":"MESSAGE-ID" } } ] } ] }
{ "object": "instagram", "entry": [ { "id": "IGID", // ID of your Instagram Professional account "time": 1569262486134, "messaging": [ { "sender": { "id": "IGSID" }, // Instagram-scoped ID for the customer who sent the message "recipient": { "id": "IGID" }, // ID of your Instagram Professional account "timestamp": 1569262485349, "message": { "mid": "MESSAGE-ID", // ID of the message sent to your business "attachments": [ { "type":"ephemeral" // no URL is included for ephemeral media } ] } } ] } ] }
桥本甲状腺炎是什么意思 | 肠系膜淋巴结肿大吃什么药 | 泡泡什么意思 | 巨蟹座的幸运色是什么颜色 | 芒果和什么相克 |
清宫和刮宫有什么区别 | 压疮用什么药最快能好 | 什么是负数 | 花五行属什么 | icu病房是什么意思 |
绍兴有什么大学 | 饭票是什么意思 | 水代表什么 | 甲状腺检查挂什么科 | 未亡人什么意思 |
尿道感染是什么原因 | 法务是干什么的 | 韧带钙化是什么意思 | 月经为什么是黑色的 | 蜂蜜对人体有什么好处和功效 |
汉菜不能和什么一起吃aiwuzhiyu.com | 生普属于什么茶hcv9jop0ns4r.cn | 正常高压是什么意思chuanglingweilai.com | 卵黄囊偏大是什么原因hcv8jop9ns9r.cn | 儿童抽动症挂什么科wmyky.com |
送人礼物送什么好hcv9jop3ns6r.cn | 恍惚什么意思creativexi.com | 7月24日是什么日子hcv8jop8ns7r.cn | 瑄字五行属什么hcv9jop3ns0r.cn | 宫腔回声不均匀什么原因hcv9jop2ns7r.cn |
蝙蝠来家里是什么预兆hcv8jop7ns5r.cn | 玉兰片和竹笋有什么区别hcv9jop5ns7r.cn | 7月31号是什么星座hcv9jop4ns7r.cn | 颈椎ct能检查出什么hcv8jop1ns1r.cn | 底妆是什么意思hcv8jop7ns5r.cn |
日出扶桑是什么意思hcv8jop8ns7r.cn | 老豆是什么意思beikeqingting.com | 结膜炎是什么症状hcv8jop2ns0r.cn | 拔完智齿能吃什么hcv7jop5ns4r.cn | 卜留克是什么菜hcv7jop6ns6r.cn |