Выполнение диалога AOG - PHP Webhook, ответ null - PullRequest
0 голосов
/ 29 января 2019

Я реализовал веб-крючок Fulfillment в PHP.Я добавляю URL на странице конфигурации Fulfillment.Но когда я пытаюсь выполнить свои намерения с помощью Действия в 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;

...