0

I have a problem with my chatfuel JSON API from my node JS app. I try to catch an error and return a message + a redirect_to_block to be able to ask the user again. My error detection works well and if I try to display a message only it works. My JSON is :

[{"text":"Please type again"}]

But I can't add a redirect_to_blocks to this (and I even loose the text message display). I tried those solutions (and probably some more) but I think I didn't get the JSON structure :

// Solution 1 
[{ "message": { "text": "Please type again" }, "redirect_to_blocks": ["When?"] }]
// Solution 2 
[{ "messages": { "text": "Please type again" }, "block_names": ["When?"], "type": "show_block", "title": "go" }]
// Solution 3 
[{ "text": "Please type again" }, "redirect_to_blocks": ["When?"] }]

And here is the block I want to add (i'm not even sure the name I have to give to the JSON)

enter image description here

Thanks !

Community
  • 1
  • 1
Julian Le Calvez
  • 453
  • 7
  • 27

2 Answers2

0

Julian, workaround that works for me is returning from API following JSON:

{
  "set_attributes": {
     "redirectBlock": <your block name>
  }
}

and build structure in Chatfuel as below:

Chatfuel flow

Now you have a dispatcher that allows you to map values from API to block titles.

0

I had your same issues,

I created a json request in my Flow that returns this json:

{ "redirect_to_blocks": ["Block name"] }

but Chatfuel never redirects to it.

I solved it creating a new block in "Automate" pane with same name and It works.

I know that it's passed much time since your question, but I hope it can helps future issues.

Emanuele Leoni
  • 168
  • 1
  • 12