S.F. Yeh
S.F. Yeh

Reputation: 59

How to do Dialogflow Integrations with facebook messenger?

I follow the instruction provided by diaglogflow as the below, however, it did not work. The "Get Started" button do pop up for my page's messenger, but click on it or say words in the default welcome message (I did set the intent as Facebook welcome) doesn't trigger any response. Do I miss any setting?

Pic.1 Get started do appear but no response:

Get started do appear no response after get started

Steps provided by diaglogflow:

  1. Get your Facebook Page Access Token and insert it in the field below.
  2. Create your own Verify Token (can be any string).
  3. Click 'START' below. 4.Use the Callback URL and Verify Token to create an event in the Facebook Messenger Webhook Setup.

Pic.2 Integration setting in dialogflow(left) and messenger setting in Facebook(right):

enter image description here

Pic. 3 Default welcome intent in diaglogflow and it's response(I had clicked the save button):

Default welcome intent in diaglogflow Response of the welcome intent

Pic4. Messenger set up for Webhook version enter image description here

Upvotes: 0

Views: 564

Answers (2)

Tasnuva Leeya
Tasnuva Leeya

Reputation: 2795

It seems you've configured the webhook for your app. Make sure you've subscribed your app to a Facebook Page.

  1. Click 'Add or Remove Pages' and select the pages you want to subscribe your app to. Your webhook will receive events for each selected page when people chat with it through Messenger.

  2. In the 'Access Tokens' section there will be a Generate Token button for each authorized Page. Make sure to save the access token, it's needed to send messages using the Send API.

  3. For each authorizedPage, the 'Webhooks' section will contain the fields the app can subscribe to. Click on "Add Subscriptions" to select desired fields. At a minimum, we recommend you choose messages and messaging_postbacks to get started.

Don't forget to choose message_postbacks. If still you face the issue re-configure the webhook. In addition test your messenger response from dialogflow from right side try it --> hi/hello --> and click default response change it to messenger if you can see the expected message from response tab that means you are missing something from page integration. I am attaching a snapshot of checking messenger response from dialogflow:

check messenger response from dialogflow

official documentation

Upvotes: 3

S.F. Yeh
S.F. Yeh

Reputation: 59

To add Tasnuva's answer, the subscription button is in the field of:

"messenger setting--> webhooks--> add/remove page right side button."

I was once confused by the add/remove page at the access page token field.

Click the button in the red square to edit it: enter image description here

Upvotes: 0

Related Questions