Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Mithilfe der Integration von Dialogflow mit dem Facebook Messenger können Sie einen Facebook Messenger-Bot erstellen, der mit Ihren Endnutzern interagiert.
Sie konfigurieren die Dialogflow-Integration und die Facebook-App so, dass sie miteinander kommunizieren.
Die Dialogflow-Integration sendet Nachrichten mithilfe der Facebook Messenger API an den Endnutzer.
Die Dialogflow-Integration empfängt Nachrichten vom Endnutzer und fungiert so als Facebook Messenger-Webhook.
Einrichtung
So richten Sie die Integration ein:
Führen Sie die Schritte zum Erstellen einer Facebook-App im Artikel zur Facebook-App-Entwicklung aus.
Richten Sie die Facebook-App für die Verwendung der Facebook Messenger Platform ein.
Führen Sie die Schritte in der Dokumentation zum Einrichten einer Facebook-App aus. Dadurch wird Folgendes möglich:
Hinzufügen der Messenger Platform zu Ihrer Facebook-App
Anmelden Ihrer App für eine Facebook-Seite.
In diesem Schritt erhalten Sie ein Zugriffstoken.
Kopieren Sie diesen Wert.
Dieses Token wird verwendet, um die Integration über die Dialogflow-Konsole zu konfigurieren.
Warten Sie aber mit dem Konfigurieren des Webhooks und dem Testen Ihrer Integration.
Konfigurieren Sie die Integration über die Dialogflow-Konsole:
Klicken Sie im linken Seitenleistenmenü auf Integrations.
Klicken Sie auf Facebook Messenger.
Ein Konfigurationsdialogfeld wird geöffnet:
Show old callback URL: Dieser Umschalter ist standardmäßig deaktiviert. Er wird vorübergehend aktiviert, um eine kürzlich erfolgte Änderung der Facebook Messenger API zu ermöglichen.
Ändern Sie diesen Umschalter nur, wenn Sie vom Dialogflow-Support dazu aufgefordert werden.
Sobald alle Kundenservicemitarbeiter aktualisiert wurden, wird diese Option entfernt.
Callback URL: Kopieren Sie diesen Wert.
Damit wird der Facebook Messenger-Webhook konfiguriert.
Verify Token: Sie können jedes beliebige private Token eingeben.
Kopieren Sie diesen Wert.
Damit wird der Facebook Messenger-Webhook konfiguriert.
Page Access Token: Geben Sie das Zugriffstoken ein, das Sie beim Erstellen der Facebook-Seite kopiert haben.
Start: Klicken Sie auf diese Option, um den Integrationsdienst für Ihren Agent zu starten.
Schließen Sie die Einrichtung der Facebook-App ab und testen Sie sie.
Führen Sie die Schritte in der Dokumentation zum Einrichten einer Facebook-App aus. Dadurch wird Folgendes möglich:
Konfigurieren des Facebook-Webhooks für Ihre App. Verwenden Sie die Werte Callback URL und Verify Token, die Sie oben kopiert haben.
Achten Sie darauf, die Optionen messages und messaging_postbacks zu aktivieren.
Testen der Anwendung
Ereignisse
Die folgenden Ereignisse werden durch diese Integration aufgerufen:
Ereignis
Beschreibung
FACEBOOK_WELCOME
Wird ausgelöst, wenn ein Endnutzer eine Unterhaltung mit dem Bot beginnt.
Bildantworten werden als Facebook Messenger-Dateianhänge an Facebook Messenger gesendet.
Der Wert message.attachment.type wird auf image festgelegt.
Die folgenden Formate werden unterstützt:
Wenn Sie andere Arten von Facebook Messenger-Nachrichten senden möchten, können Sie eine benutzerdefinierte Nutzlast verwenden.
Das allgemeine Format der benutzerdefinierten Nutzlast sieht so aus:
{
"facebook": {
message
}
}
Geben Sie anstelle von message das Facebook Messenger-Objekt message an.
Weitere Informationen zum Objekt message finden Sie in der Referenz zur Facebook Messenger API.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-18 (UTC)."],[[["\u003cp\u003eThis integration allows you to create a Facebook Messenger bot using Dialogflow to interact with users, sending and receiving messages via the Facebook Messenger API.\u003c/p\u003e\n"],["\u003cp\u003eThe setup involves creating a Facebook app, configuring it for the Messenger Platform, and then integrating it with Dialogflow through the Dialogflow console using a Page Access Token, Callback URL, and a Verify Token.\u003c/p\u003e\n"],["\u003cp\u003eThe default agent language is the only language supported by this integration.\u003c/p\u003e\n"],["\u003cp\u003eDialogflow translates several rich response messages, including images, cards, and quick replies, into their corresponding Facebook Messenger message types.\u003c/p\u003e\n"],["\u003cp\u003eCustom payloads can be used to send more complex Facebook messenger messages such as audio, video, and file attachments, in addition to the rich responses already translated by Dialogflow.\u003c/p\u003e\n"]]],[],null,["# Messenger from Facebook\n\nUsing the Dialogflow Facebook Messenger integration,\nyou can create a Facebook Messenger bot to interact with your end-users.\n\n\n| **Note:** When using a third party integration, requests and end-user data are sent to both Google and the third party. The terms of service, SLA, pricing, and quotas [for your agent edition](/dialogflow/docs/editions) are applicable for Google's handling of these requests. The third party's terms of service, SLA, pricing, and quotas are applicable for the third party's handling of these requests.\n\n\u003cbr /\u003e\n\nLimitations\n-----------\n\nOnly the\n[default agent language](/dialogflow/es/docs/agents-settings#lang)\nis supported by this integration.\n\nHow it works\n------------\n\nThis is how the integration works:\n\n- You create a Facebook app that uses the [Facebook Messenger platform](https://developers.facebook.com/docs/messenger-platform/overview).\n- You configure the Dialogflow integration and Facebook app, so that they communicate with each other.\n- The Dialogflow integration sends messages to the end-user by using the [Facebook Messenger API](https://developers.facebook.com/docs/messenger-platform/reference/send-api/).\n- The Dialogflow integration receives messages from the end-user by acting as the [Facebook Messenger Webhook](https://developers.facebook.com/docs/messenger-platform/webhooks).\n\nSetup\n-----\n\nTo set up the integration:\n\n1. Follow the steps to create a Facebook app:\n [Facebook App Development](https://developers.facebook.com/docs/development).\n\n2. Set up the Facebook app to use the Facebook Messenger Platform.\n Follow steps in the\n [Setting Up Your Facebook App](https://developers.facebook.com/docs/messenger-platform/webhooks)\n documentation to accomplish the following:\n\n - Add the Messenger Platform to your Facebook app.\n - Subscribe your app to a Facebook page. You are provided with an access token at this step. Copy this value. This token is used to configure the integration from the Dialogflow Console.\n - Don't configure the webhook or test your integration yet.\n3. Configure the integration from the Dialogflow Console:\n\n 1. Go to the [Dialogflow ES console](https://dialogflow.cloud.google.com).\n 2. Click **Integrations** in the left sidebar menu.\n 3. Click **Facebook Messenger**.\n 4. A configuration dialog opens:\n\n \u003cbr /\u003e\n\n - **Show old callback URL**: If this toggle is shown, it defaults to off. This is a temporary option to accommodate a recent modification to the Facebook Messenger API. Do not change this toggle unless instructed by Dialogflow support. After all agents have been updated, this option is removed.\n - **Callback URL**: Copy this value. This is used to configure the Facebook Messenger Webhook.\n - **Verify Token**: You can enter any private token you need. Copy this value. This is used to configure the Facebook Messenger Webhook.\n - **Page Access Token**: Enter the access token you copied when creating the Facebook page.\n - **Start**: Click to start this integration service for your agent.\n4. Finish setup of the Facebook app and test it.\n Follow steps in the\n [Setting Up Your Facebook App](https://developers.facebook.com/docs/messenger-platform/webhooks)\n documentation to accomplish the following:\n\n - Configure the Facebook webhook for your app. Use the **Callback URL** and **Verify Token** values you copied above. Be sure to enable **messages** and **messaging_postbacks**.\n - Test your app.\n\nEvents\n------\n\nThe following [events](/dialogflow/docs/events-overview)\nare invoked by this integration:\n\nRich response messages\n----------------------\n\nThis integration translates some\n[rich response messages](/dialogflow/docs/intents-rich-messages)\nmessages to\n[Facebook Messenger Platform message types](https://developers.facebook.com/docs/messenger-platform/send-messages).\n\n### Image responses\n\n[Image responses](/dialogflow/docs/intents-rich-messages#image)\nare sent to Facebook Messenger as\n[Facebook Messenger file attachment messages](https://developers.facebook.com/docs/messenger-platform/reference/attachment-upload-api#attachment).\nThe `message.attachment.type` value is set to `image`.\nThe following formats are supported:\n\n- jpg\n- png\n- static gif\n- animated gif\n\n### Card responses\n\n[Card responses](/dialogflow/docs/intents-rich-messages#card)\nare sent to Facebook Messenger as\n[Facebook Messenger generic templates](https://developers.facebook.com/docs/messenger-platform/reference/templates/generic).\n\n### Quick reply responses\n\n[Quick reply responses](/dialogflow/docs/intents-rich-messages#quick)\nare sent to Facebook Messenger as\n[Facebook Messenger quick replies](https://developers.facebook.com/docs/messenger-platform/reference/buttons/quick-replies).\n\n### Custom payload responses\n\nTo send other types of Facebook Messenger messages,\nyou can use a\n[custom payload](/dialogflow/docs/intents-rich-messages#custom).\n\nThe general format of the custom payload looks like: \n\n```\n{\n \"facebook\": {\n message\n }\n}\n```\n\nIn place of `message`, provide the Facebook Messenger `message` object.\nFor details of the `message` object, see the\n[Facebook Messenger API reference](https://developers.facebook.com/docs/messenger-platform/reference/send-api/).\n\nFor example:\n\n- Send an audio link: \n\n ```\n {\n \"facebook\": {\n \"attachment\": {\n \"type\": \"audio\",\n \"payload\": {\n \"url\": \"https://example.com/audio/test.mp3\"\n }\n }\n }\n }\n \n ```\n- Send a playable video: \n\n ```\n {\n \"facebook\": {\n \"attachment\": {\n \"type\": \"video\",\n \"payload\": {\n \"url\": \"https://example.com/video.mp4\"\n }\n }\n }\n }\n \n ```\n- Send a file: \n\n ```\n {\n \"facebook\": {\n \"attachment\": {\n \"type\": \"file\",\n \"payload\": {\n \"url\": \"https://example.com/file.pdf\"\n }\n }\n }\n }\n \n ```"]]