问题
I'm trying to create a conversation with multiple members and generating a conversation id. My goal is to have the bot message each member listed in the "members" key one-by-one. It works exactly as it should when I only put one item in the "members" key and I am able to generate a conversation id. However, I'm getting an error when I put 2 or more items in the "members" key even though it's supposed to be an array of members.
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"
}
This yields a HTTP 400 Bad Request Error
{
"error": {
"code": "BadSyntax",
"message": "Incorrect conversation creation parameters"
}
}
Could anyone please help me with this? Thank you so much.
回答1:
The reason members
is an array is because it can be used for group conversations. You have set isGroup
to false
so you are not creating a group conversation. If you want to create multiple conversations then you will need to send multiple requests, which you've said is working.
来源:https://stackoverflow.com/questions/60844489/bot-framework-api-create-conversation-with-multiple-members