Bot Framework REST API send proactive message to multiple users with one conversation ID

不羁岁月 提交于 2020-04-17 22:06:50

问题


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/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"
}

I'm getting a BadSyntax HTTP 400 error:

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

Is this possible?


回答1:


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.



来源:https://stackoverflow.com/questions/60842516/bot-framework-rest-api-send-proactive-message-to-multiple-users-with-one-convers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!