本文介绍了无法在Bot框架中使用DirectLineAPI发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Directline API进行网络聊天.

I am using directline api for webchat.

生成令牌后,我将在正文中的标题和活动对象中的令牌以及该URL:

After generating token, Along with that token in the header and activity object in the body I am requesting to this url:

https://directline.botframework.com/v3/directline/conversations/ {conversationID}/活动

https://directline.botframework.com/v3/directline/conversations/{conversationID}/activities

我得到404页面找不到响应:

I am getting 404 page not found response:

这是我的Activity对象:

Here is my Activity object:

我的请求正文:

我不知道该如何解决.

推荐答案

如果您想向机器人发送活动,请您正在使用的API 看起来不错.

If you’d like to send an activity to the bot, the API that you are using seems ok.

POST https://directline.botframework.com/v3/directline/conversations/{conversationID}/activities

根据我的测试,我怀疑您提供的{conversationID}出现问题,从而导致了问题.请尝试打开新对话,并使用返回的对话ID发送活动并检查活动是否正常.

Based on my test, I suspect something wrong with {conversationID} that you provided, which causes the issue. Please try to open a new conversation and use the returned conversation id to send activity and check if it works fine.

在测试中,如果我提供的对话ID不正确,我将在提琴手中收到 404 并显示"未知对话"错误消息.

In my test, if I provide an incorrect conversation id, I will get 404 with "Unknown conversation" error message in fiddler.

这篇关于无法在Bot框架中使用DirectLineAPI发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 01:10