【问题标题】:Cant send message using directlineapi in bot framework无法在机器人框架中使用 directlineapi 发送消息
【发布时间】:2018-06-05 14:30:46
【问题描述】:

我正在使用 Directline api 进行网络聊天。

生成令牌后,连同标头中的令牌和正文中的活动对象,我请求此 url:

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

我收到 404 page not found 响应:

这是我的 Activity 对象:

{"type":"message","text":"Testing Directline API","conversation":{"id":"conversationId"},"recipient":{"id":"用户请求 id"},"from":{"id":"mybot id","name" :"我的机器人名称 "}}

我的请求正文:

{"type":"conversationUpdate","id":"ID","timestamp":"2017-12-23T05:03:45.5925924Z","serviceUrl":"https://directline.botframework.com/","channelId" :"webchat","from":{"id":"FROMID"},"conversation":{"id":"conversationid"},"recipient":{"id":"mybotid","name": “机器人 名称"},"membersAdded":[{"id":"mybotid","name":"机器人名称"}]}

我不知道如何解决这个问题。

【问题讨论】:

    标签: rest botframework direct-line-botframework


    【解决方案1】:

    得到 404 页面未找到响应

    如果您想向机器人发送活动,您使用的 the API 似乎没问题。

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

    根据我的测试,我怀疑您提供的 {conversationID} 有问题,这会导致问题。请尝试open a new conversation 并使用返回的会话 ID 发送活动并检查它是否正常。

    在我的测试中,如果我提供了不正确的对话 ID,我将在提琴手中收到 404 和“未知对话”错误消息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-16
      • 1970-01-01
      • 2021-09-10
      • 1970-01-01
      相关资源
      最近更新 更多