我创建了我的lex bot并发布了它。我现在正试图从其他客户端测试它。
这个想法一旦从休息客户端工作,我可以使用其他调用将其与我的自定义UI集成。
我正在使用来自posttext的请求正文,根据此链接http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html
当我从休息客户端使用此功能时,我将收到Missing Authentication Token。
使用的终点网址是https://runtime.lex.us-east-1.amazonaws.com
我是否应该在AWS Signature等授权标头中添加一些内容以使其工作。
您需要在“授权”选项卡中包含AWS签名,其中包含有权运行Lex bot的IAM用户的详细信息。
步骤:1。在AWS中转到IAM - >用户 - >添加用户
点击创建组。
点击发送,您应该得到这样的回复:
{
"dialogState": "Fulfilled",
"intentName": "yourIntentName",
"message": "A response for that intent",
"responseCard": null,
"sessionAttributes": {},
"slotToElicit": null,
"slots": {}
}
更新
另请注意 - POST网址格式为:
https://runtime.lex.us-east-1.amazonaws.com/bot/MyBotName/alias/myMyAlias/user/aUniqueUserID/text and it should be a POST
还要确保标题Content-Type是application / json,身体也是如此。