PHP-DialogFlow-Webhooks-Fulfillment-API icon indicating copy to clipboard operation
PHP-DialogFlow-Webhooks-Fulfillment-API copied to clipboard

Failed to parse Dialogflow

Open dudunegrinhu opened this issue 6 years ago • 2 comments

Hi,

So far this is the best PHP Webhook I found but I'm having and error when I do any build response and response after.

If I do $wh->respond_simpleMessage('Say this out loud', 'Display this text on screen');

It works perfect but If I do:

$textToSpeech = "Say this text out loud"; $displayText = "Display this text on screen"; $wh->build_simpleResponse($textToSpeech, $displayText); $wh->respond();

I get the error below: Failed to parse Dialogflow response into AppResponse because of empty speech response

Am I missing something?

dudunegrinhu avatar Jul 24 '18 20:07 dudunegrinhu

I was able to make it work by changing the respond function. This is my final $response

$response = array( 'fulfillmentText' => $this->speech, 'payload' => $integrations, 'data' => $integrations, 'displayText' => $this->speech, 'speech' => $this->speech, );

dudunegrinhu avatar Jul 24 '18 22:07 dudunegrinhu

I get "Webhook call failed. Error: Failed to parse webhook JSON response: Cannot find field: speech in message"

vivekudayan avatar Oct 06 '18 06:10 vivekudayan