alexa-skills-kit - alexa 技能的 INVALID_SKILL_RESPONSE
问题描述
我刚刚开始为 Alexa 技能构建自己的 Web 服务。
我的 Web 服务支持 HTTPS,当我使用 alexa 模拟器进行测试时,端点被命中,但我收到错误“INVALID_SKILL_RESPONSE”。
这是我的 php 代码的简单响应:
return response(
[
'version' => '1.0',
'response' => [
'outputSpeech' => [
'type' => 'PlainText',
'text' => 'Hello world',
]
]
],
200,
[
'Content-Type' => 'application/json',
]
);
什么可能导致问题?
解决方案
我不确定这个response
功能是从哪里来的。尝试这样的事情:
<?php
$responseArray = [
'version' => '1.0',
'response' => [
'outputSpeech' => [
'type' => 'PlainText',
'text' => 'Hello World'
],
'shouldEndSession' => true
]
];
header( 'Content-Type: application/json' );
echo json_encode( $responseArray );
?>
推荐阅读
- bokeh - 如何使用散景数据表显示嵌套字典
- lerna - Lerna 杀死纱线工作区中的后台进程?
- python - Python列表分组键
- java - 如何在 itext 的 pdf 表格单元格内创建组合框或下拉列表
- julia - 将 python 类移植到 Julialang
- java - Spring 存储库:使用构造函数的 HQL 不解析 NULL 值
- python - 序列模型的不正确信号预测
- java - 在 Android Studio 的 SDK 工具中找不到 Android Emulator
- java - 如何在 CSVFormat 中避免逗号前的反斜杠
- kubernetes - 在 kind 集群中编辑 extraPortMappings