[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eThis document describes how to integrate Conversational Agents (Dialogflow CX) with Meta Messenger to create a bot for interacting with end-users, leveraging the Meta Messenger Platform and API.\u003c/p\u003e\n"],["\u003cp\u003eThe integration involves creating a Meta app, configuring both the Conversational Agents (Dialogflow CX) integration and the Meta app to communicate, and using Meta Webhooks for message handling.\u003c/p\u003e\n"],["\u003cp\u003eWhen using the integration, end-user data is sent to both Google and the third-party Meta, with each party's terms of service, SLA, pricing, and quotas being applicable to their handling of requests.\u003c/p\u003e\n"],["\u003cp\u003eThe integration supports custom event handlers for events like \u003ccode\u003eFACEBOOK_WELCOME\u003c/code\u003e (triggered by the Get Started button) and \u003ccode\u003eFACEBOOK_MEDIA\u003c/code\u003e (triggered by message attachments), enabling tailored responses.\u003c/p\u003e\n"],["\u003cp\u003eRich response messages, such as text and image messages, are supported via custom payloads in Fulfillment, following the format defined by the Meta Messenger Send API parameters.\u003c/p\u003e\n"]]],[],null,["# Messenger from Meta\n\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nUsing the Meta Messenger integration, you can create a Meta\nMessenger 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\nHow it works\n------------\n\n| **Note:** This integration does not support [Workplace from Meta](https://developers.facebook.com/docs/workplace).\n\nThis is how the integration works:\n\n- You create a Meta app that uses the [Meta Messenger Platform](https://developers.facebook.com/docs/messenger-platform/overview).\n- You configure the Conversational Agents (Dialogflow CX) integration and Meta app, so that they communicate with each other.\n- The Conversational Agents (Dialogflow CX) integration sends messages to the end-user by using the [Meta Messenger API](https://developers.facebook.com/docs/messenger-platform/reference/send-api/).\n- The Conversational Agents (Dialogflow CX) integration receives messages from the end-user by acting as the [Meta Webhooks for Messenger Platform](https://developers.facebook.com/docs/messenger-platform/getting-started/webhook-setup/).\n\nSetup\n-----\n\n| **Note:** Make sure [billing is enabled](/dialogflow/cx/docs/quick/setup#billing) on your project before testing the integration.\n\nTo set up the integration:\n\n1. Follow the steps to create a Meta app:\n [Meta App Development](https://developers.facebook.com/docs/apps).\n\n2. Set up the Meta app to use the Meta Messenger Platform. Follow the\n steps in the\n [Meta Webhooks for Messenger Platform](https://developers.facebook.com/docs/messenger-platform/getting-started/app-setup)\n documentation to accomplish the following:\n\n - Add the Messenger Platform to your Meta app.\n - Subscribe your app to a Meta page. Make sure `messages` and `messaging_postbacks` are enabled in the page subscription.\n - You are provided with an access token at this step. Copy this value. This token is used to configure the integration from the Conversational Agents (Dialogflow CX) console.\n - Do not configure the webhook or test your integration yet.\n3. Configure the integration from the Conversational Agents (Dialogflow CX) console:\n\n 1. Go to the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n 2. Click the **Manage** tab on the left panel.\n 3. Click **Integrations** in the left sidebar menu.\n 4. Click the **Connect** button on the **Meta Messenger** tile.\n 5. A configuration dialog opens:\n\n - **App secret** : Enter the app secret from\n [App Dashboard Basic Settings](https://developers.facebook.com/docs/development/create-an-app/app-dashboard/basic-settings).\n\n - **Verify token**: You can enter any private token you desire. Copy\n this value. This is used to configure the Meta Messenger\n Webhook.\n\n - **Page access token**: Enter the access token you copied during the\n Meta app setup above.\n\n - **Enable get started button** : Please see\n [Get started button](#get-started-button) section.\n\n - **Webhook URL**: Copy this value. This is used to configure the\n Meta Messenger Webhook.\n\n - **Start**: Click to start this integration service for your agent.\n\n4. Finish setup of the Meta app and test it. Follow steps in the\n [Meta Webhooks for Messenger Platform](https://developers.facebook.com/docs/messenger-platform/getting-started/app-setup)\n documentation to accomplish the following:\n\n - Configure the Meta webhook for your app. Use the **Webhook URL** and **Verify token** values you copied above. Be sure to enable `messages` and `messaging_postbacks` in the page subscription.\n - Test your app.\n\nEvents\n------\n\nThe following events are invoked by this integration. You can create\n[custom event handlers](/dialogflow/cx/docs/concept/handler?hl=en#event-custom)\nto define what to do when the events are triggered.\n\nGet started button\n------------------\n\nTo set up\n[Meta Messenger Get Started Button](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/get-started-button/):\n\n1. Toggle **Enable get started button** when enabling this integration service.\n\n - This integration service enables the button for you by calling\n [Messenger Profile API](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api).\n\n ```sh\n curl -X POST \\\n -H \"Content-Type: application/json\" \\\n -d '{\"get_started\": {\"payload\": \"FACEBOOK_WELCOME\"}}' \\\n \"https://graph.facebook.com/v10.0/me/messenger_profile?access_token=${PAGE_ACCESS_TOKEN}\"\n ```\n2. Create a\n [custom event handler](/dialogflow/cx/docs/concept/handler?hl=en#event-custom)\n for `FACEBOOK_WELCOME` event.\n\nTo test it:\n\n1. Delete the previous conversation with your Meta page (if applicable).\n\n - The **Get Started** button only shows up on new conversations.\n2. Start a new conversation with your Meta page.\n\n3. Click the **Get Started** button, and verify the response from the custom\n event handler.\n\nYou can always call\n[Messenger Profile API](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api)\nto manage the **Get Started** button. This might be helpful for testing.\n\nFor example, the following request checks the status of **Get Started** button: \n\n```sh\ncurl -X GET \\\n\"https://graph.facebook.com/v10.0/me/messenger_profile?fields=get_started&access_token=${PAGE_ACCESS_TOKEN}\"\n```\n\nThe following request disables the **Get Started** button: \n\n```sh\ncurl -X DELETE \\\n-H \"Content-Type: application/json\" \\\n-d '{\"fields\": [\"get_started\"]}' \\\n\"https://graph.facebook.com/v10.0/me/messenger_profile?access_token=${PAGE_ACCESS_TOKEN}\"\n```\n\nRich response messages\n----------------------\n\nThe rich response messages are supported via **Custom Payload** in\n[Fulfillment](/dialogflow/cx/docs/concept/fulfillment). Please see\n[Send API Parameters Message Object](https://developers.facebook.com/docs/messenger-platform/reference/send-api#parameters)\nfor the message format.\n\nFor example, the following custom payload provides a simple text message: \n\n```json\n{\n \"text\": \"Hello, world\"\n}\n```\n\nThe following custom payload provides an image message: \n\n```json\n{\n \"attachment\": {\n \"type\": \"image\",\n \"payload\": {\n \"url\": \"https://example.com/test.jpg\"\n }\n }\n}\n```\n\nChannel specific responses\n--------------------------\n\nAfter you configure the [channel-specific responses](/dialogflow/cx/docs/concept/fulfillment#channel-specific), the channel `DF_CX_FB_MESSENGER` is automatically used when the agent responds to Meta Messenger messages."]]