Mit Webhooks erhältst du HTTP-Benachrichtigungen in Echtzeit, die dich über Änderungen an bestimmten Objekten im Meta Social Graph informieren. Wir können dir beispielsweise eine Benachrichtigung senden, wenn ein*e Kund*in deinem professionellem Instagram-Konto eine Nachricht sendet. Mit Webhooks-Benachrichtigungen kannst du Messaging-Änderungen nachverfolgen und Ratenbegrenzungen vermeiden, die auftreten können, wenn du die Endpunkte der Messenger-Plattform abfragst, um Änderungen nachzuverfolgen.
Du musst die folgenden Anforderungen implementieren, um Webhooks-Benachrichtigungen für Instagram Messaging zu erhalten.
instagram_basic
, instagram_manage_messages
und pages_manage_metadata
.Hinweis: Du musst alle Messaging-Apps für dein Unternehmen im Messaging-Webhook abonnieren.
Erfahre mehr über Zugriffslevels , App-Modi und App-Rollen.
Webhook-Feld | Beschreibung |
---|---|
| Eine Benachrichtigung wird gesendet, wenn ein*e Kund*in auf eine Nachricht reagiert bzw. wenn er*sie die Reaktion wieder rückgängig macht. Die Reaktionen |
| Es wird eine Benachrichtigung gesendet, wenn ein*e Kund*in deinem Unternehmen Folgendes sendet:
Eine Benachrichtigung wird auch dann gesendet, wenn dein Unternehmen eine Nachricht an eine*n Kund*in sendet. Es wird keine Benachrichtigung gesendet, wenn dein Unternehmen auf eine Nachricht reagiert bzw. die Reaktion wieder rückgängig macht. Dieser Rückruf erfolgt, wenn eine Nachricht von deinem Instagram-Konto gesendet wurde. Das Flag |
| Es wird eine Benachrichtigung gesendet, wenn ein*e Kund*in auf eine Icebreaker-Option oder die Schaltfläche „Generische Vorlage“ geklickt hat. Erfordert v8.0 oder höher. Für die Einbindung des Feldes |
| Es wird eine Benachrichtigung gesendet, wenn eine Nachricht von dem*der Empfänger*in gelesen wurde. |
| Es wird eine Benachrichtigung gesendet, wenn ein |
| Bei einem Nachrichten-Vorgang mit mehreren wird eine Benachrichtigung gesendet, wenn ein*e Kund*in deinem Unternehmen eine Nachricht sendet, die App jedoch zum Zeitpunkt des Sendens der Nachricht nicht die Kontrolle über die Unterhaltung hatte. |
Es folgen Beispiele für die Arten von Webhook-Benachrichtigungen, die du erhalten kannst.
{ "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" } } ] } ] }