在 Azure 门户中的测试网络聊天中,我让机器人通过从 session.message.address.conversation.id 获取对话 ID 来回复我。
我希望使用此处描述的方法查看此对话 ID 的事件:
(发布https://directline.botframework.com/v3/directline/conversations/abc123/activities )
但是,我收到以下错误:
{
"error": {
"code": "BadArgument",
"message": "Unknown conversation"
}
}
我也尝试过:
有关如何使用直线发布/查看网络聊天事件的任何帮助吗?
谢谢!
最佳答案
解释您的问题
我无法通过 POST
对话重现您的问题。实际上,我只能通过以下步骤重现您的问题:
生成直接 token =>利用响应conversationId
和 token
直接调用Retrieve activities with HTTP GET与:
GET https://directline.botframework.com/v3/directline/conversations/abc123/activities
Authorization: Bearer token
正确的步骤是:
生成 token => POST
到 Start a conversation => GET
到 Retrieve activities with HTTP GET .
满足您的要求 我认为我们不能在转换之外中断,如 Generate a Direct Line token 的描述。
To generate a Direct Line token that can be used to access a single conversation.
因此您从其他地方请求的 token 无法请求网络聊天中的事件。
解决方法
您可以利用BotFramework-WebChat快速搭建网站bot测试环境。并在您自己的服务器中生成用于机器人客户端身份验证的 token 。然后,您可以使用生成的 token 和对话 ID 来请求机器人与该机器人客户端网站之间的所有事件。
关于node.js - 如何在 Microsoft Bot 服务中使用直线发布到网络聊天?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47933304/