Is it possible send custom json to facebook through channel connector

I’m writing a custom action, which is using HTTP req/resp method. I would like to send custom JSON to facebook channel to display quick replys and later carousal cards. I see these are the options available by default:

{
    "text": "hey there",
    "buttons": [],
    "image": null,
    "elements": [],
    "attachments": []
}

I have tried using elements key to send my custom response. Below is the HTTP response that I’m sending from my server to RASA core, based on this part of RASA documentation:

{
  "responses": [
    {
      "elements": [
        {
          "text": "What's your favorite House in Game Of Thrones",
          "quick_replies": [
            {
              "content_type": "text",
              "title": "Stark",
              "payload": "STARK"
            },
            {
              "content_type": "text",
              "title": "Lannister",
              "payload": "LANNISTER"
            },
            {
              "content_type": "text",
              "title": "Targaryen",
              "payload": "TARGARYEN"
            },
            {
              "content_type": "text",
              "title": "None of the above",
              "payload": "OTHER"
            }
          ]
        }
      ]
    }
  ]
}

But I’m getting an error saying, ERROR rasa_core.processor - Encountered an exception while running action 'action_menu'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.

Please help…

1 Like