1
votes

I'm trying to make a correct fulfillment response to the simple request:

  "queryResult": {
    "queryText": "test",
    "action": "test",
    "parameters": {},
    /*...*/

The response is:

{
  "fulfillmentText": "good",
  "fulfillmentMessages": [
    {
      "text": [
        "ok"
      ]
    }
  ],
/*...*/

DialogFlow replies:

Webhook call failed. Error: Failed to parse webhook JSON response: Expect message object but got: ["ok"].

What's the correct reply, so DialogFlow would accept it?

1

1 Answers

1
votes

Your response is very close to the way it needs to be. Confusingly, the message object that it is asking for is also called "text" so the response needs to look like this:

{"fulfillmentText": "good",
 "fulfillmentMessages": [
                {
                  "text": 
                      {"text":[
                                "ok"
                        ]
                    }
                }
            ]
        }