Webhooks memungkinkan Anda menerima notifikasi HTTP realtime tentang perubahan objek tertentu di grafik sosial Meta. Contoh: kami bisa mengirimi Anda notifikasi saat pelanggan mengirim pesan kepada akun Profesional Instagram Anda. Dengan notifikasi Webhooks, Anda dapat melacak perubahan pesan dan menghindari batas laju yang akan terjadi jika Anda meng-kueri endpoint Platform Messenger untuk melacak perubahan.
Anda harus menerapkan persyaratan berikut untuk menerima notifikasi Webhooks untuk Berkirim Pesan di Instagram.
instagram_basic
, instagram_manage_messages
, dan pages_manage_metadata
Catatan: Anda harus berlangganan semua aplikasi berkirim pesan untuk bisnis Anda ke Webhooks berkirim pesan.
Pelajari selengkapnya tentang level akses , mode aplikasi , dan peran aplikasi.
Kolom Webhook | Deskripsi |
---|---|
| Notifikasi dikirim ketika pelanggan menanggapi atau tidak menanggapi pesan Graph API v12.0 dan setelahnya mendukung tanggapan |
| Notifikasi dikirimkan ketika pelanggan mengirimi bisnis Anda:
Notifikasi juga dikirimkan ketika bisnis Anda mengirim pesan kepada pelanggan. Notifikasi tidak akan dikirim ketika bisnis Anda menanggapi atau tidak menanggapi pesan pelanggan. Panggilan balik ini akan terjadi ketika pesan telah terkirim oleh akun Instagram Anda. Bendera |
| Notifikasi dikirimkan ketika pelanggan mengeklik opsi Pencair Suasana atau tombol Template Generik Memerlukan v8.0 atau yang lebih baru. Memerlukan v11.0 atau yang lebih baru untuk memasukkan kolom |
| Notifikasi dikirim ketika pesan telah dibaca oleh penerima |
| Notifikasi dikirim ketika tautan |
| Ketika alur pesan memiliki beberapa aplikasi, notifikasi dikirim ketika pelanggan mengirim pesan kepada bisnis Anda, tetapi aplikasi tidak mengontrol percakapan pada saat pesan dikirim. |
Berikut ini adalah contoh untuk jenis notifikasi Webhooks yang dapat Anda terima.
{ "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, or video "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" } } ] } ] }