0

I'm new on chatfuel bot platform.

I'm using json api plugin (As by documentation https://docs.chatfuel.com/api/json-api/json-api)

In my backend, I produce below json response for the plugin , this is my backend URL: http://185.206.145.26:12223/latestnews?locale=en_US&first%20name=John

{
  "messages": [
    {
      "text": "Hi Fety! There are the latest news"
    },
    {
  "attachment": {
    "type": "template",
    "payload": {
      "template_type": "generic",
      "elements": [
        {
          "image_url": "http://scd.rfi.fr/sites/filesrfi/imagecache/rfi_43_medium/sites/images.rfi.fr/files/aef_image/2019-01-11t145823z_1912744290_rc1428cade00_rtrmadp_3_sudan-protests_0.jpg",
          "title": "Soudan: les manifestations se poursuivent, la répression aussi",
          "subtitle": "www.rfi.fr, 2019-01-12 04:03",
          "buttons": [
            {
              "type": "web_url",
              "url": "http://www.rfi.fr/afrique/20190112-soudan-manifestations-poursuivent-repression",
              "title": "VOIR L'ARTICLE"
            }
          ]
        },
        {
          "image_url": "http://scd.rfi.fr/sites/filesrfi/imagecache/rfi_43_medium/sites/images.rfi.fr/files/aef_image/2019-01-11t182406z_855534608_rc1a370ea010_rtrmadp_3_usa-shutdown-lawsuit_0.jpg",
          "title": "[Reportage] «Shutdown»: un quotidien compliqué pour des milliers d'employés",
          "subtitle": "www.rfi.fr, 2019-01-12 04:01",
          "buttons": [
                {
                  "type": "web_url",
                  "url": "http://www.rfi.fr/ameriques/20190112-reportage-shutdown-quotidien-complique-800000-employes",
                  "title": "VOIR L'ARTICLE"
                }
              ]
            }
          ]
        }
      }
    }
  ]
}

The problem is when I call this api from blocks, Only, the text object sent and not the case for attachment.I am sure that my json structure is ok but I have to missed some tricks on chatfuel.

Thank you!

Fety
  • 1
  • 4

1 Answers1

0

I’m sitting on the couch right now but I’m pretty sure “attachments” is a component of a message, not a message. You’ve got it as a message object itself under the messages array.

Solution is to move it into the message object above, after “text”.

Nick
  • 466
  • 1
  • 6
  • 12