Bot Framework REST API使用一个对话ID将主动消息发送给多个用户 [英] Bot Framework REST API send proactive message to multiple users with one conversation ID

查看:96
本文介绍了Bot Framework REST API使用一个对话ID将主动消息发送给多个用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法可以仅使用一个对话ID向用户发送1:1消息?因此,我不是在遍历每个用户并生成一个会话ID,而是试图创建一个请求以生成具有多个成员的会话ID.

I'm wondering if there is a way to send 1:1 message to users using only one conversation id? So instead of looping through each user and generating a conversation id, I'm trying to create a request to generate a conversation ID with multiple members.

请参阅下面的有效载荷:

See payload below:

POST/v3/会话

POST /v3/conversations

{
  "activity": {
    "type": "message",
    "channelId": "msteams",
    "text": "Testing"
  },
  "bot": {
    "id": "215000000-00000-0000-00000",
    "name": "Test",
    "aadObjectId": null,
    "role": null
  },
  "isGroup": false,
  "members": [
    {
      "id": "29:asda123123asdad123sdadassaw1233fwmHog5cU9_rRLIauRiA6Mzsdadassaw1233fwm1H",
      "name": null,
      "aadObjectId": null,
      "role": null
    },
    {
      "id": "29:asdadassaw1233fwmHog5cU9_rRLIauRiA6MzE4TJ98ldUVqOm32asd12qCZs5eu_pjL8mUg",
      "name": null,
      "aadObjectId": null,
      "role": null
    }
  ],
  "tenantId": "12312312adasdadtest"
}

我收到BadSyntax HTTP 400错误:

I'm getting a BadSyntax HTTP 400 error:

{
    "error": {
        "code": "BadSyntax",
        "message": "Incorrect conversation creation parameters"
    }
}

这可能吗?

推荐答案

诸如主动消息都是特定于渠道的,因此明确说明您在哪个渠道中使用是很重要的这些情况.从JSON看来,您正在使用Microsoft Teams. Microsoft中的每个对话团队将具有唯一的会话ID,并且机器人与用户之间的每次1:1聊天都必须是其自己的会话,因此无法仅使用一个会话ID进行与用户的多次聊天.

Things like proactive messaging, creating a conversation, and conversation ID's are all channel-specific so it's important to be explicit about what channel you're using in these situations. From your JSON it looks like you're using Microsoft Teams. Every conversation in Microsoft Teams will have a unique conversation ID, and every 1:1 chat between a bot and a user needs to be its own conversation, so there is no way to use only one conversation ID for multiple chats with users.

这篇关于Bot Framework REST API使用一个对话ID将主动消息发送给多个用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆