1

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?

Mikhail
  • 13
  • 3

1 Answers1

1

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"
                        ]
                    }
                }
            ]
        }
Ariel
  • 61
  • 3
  • Ran into this problem while trying to migrate from V1 to V2. The documentation on the main Fulfillment Migration page seems incorrect as the example matches the one from the OP. However, further down they do provide a corrected example. – user875318 Aug 05 '19 at 21:56