2

I have a problem to configure my Facebook messenger bot to trigger an event in my Dialogflow agent I tried many things but none of theme seems to work.

my approach is I send a list of Items to the user with a postback button on each and when the user click on a button I need to trigger an event in my agent on dialogflow so I can parse the data received with that event

Here is my template:

    {
  "facebook": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "generic",
        "elements": [
          {
            "title": "Simple title",
            "image_url": "https://exemple.com/test.jpg",
            "subtitle": "Simple subtitle",
            "default_action": {
              "type": "web_url",
              "url": "https://www.exemple.com",
              "messenger_extensions": true,
              "webview_height_ratio": "tall"
            },
            "buttons": [
              {
                "type": "postback",
                "payload": "{'event':{'name':'custom_event','data':{'name':'Sam'}},'timezone':'America/New_York','lang':'en','sessionId':'1321321'}",
                "title": "Show data"
              }
            ]
          }
        ]
      }
    }
  },
  "recipient": {
    "id": "121323423434534"
  }
}
Y. Afnisse
  • 150
  • 2
  • 15

0 Answers0