我用PHP实现了实现Webhook。我在实现配置页面中添加了URL。但是,当我试图通过Google上的“操作”表达我的意图时,这是我的错误:
**MalformedResponse Failed to parse Dialogflow response into AppResponse because of empty speech response.**
查看日志:
Webhook call failed. Error: Failed to parse webhook JSON response: null
我的php代码:
$return_defaults = array( "fulfillmentText" => "respons of it", "fulfillmentMessages" => array( array( "text" => array( "text reponse" ), ) ), "payload" => array( "google" => array ( "expectUserResponse" => true, "richResponse" => array( "items" => array( array( "simpleResponse" => array( "textToSpeech" => "bye bye calamba" ), ), ), ), ), ), ); $ReturnValue = json_encode($return_defaults); echo $ReturnValue;