I'm trying to create new convesation for just created channel using Nodejs + botframework v4.9.2.
I've
- created new Channel using POST https://graph.microsoft.com/beta/teams/${teamId}/channels
- new tab using POST https://graph.microsoft.com/beta/teams/${req.teamId}/channels/${req.channelId}/tabs
- I can see new channel and tab in Teams UI
- trying to create new conversation via
Conversations.createConversationfrom bot sdk, it's basically calling POST https://directline.botframework.com/v3/conversations with passing new channel id and getting 405 BadArgumentThis channel does not support this operation
I'm running bot locally and proxying via ngrok. Also I can access GET /v3/conversations.
Updated code
Get Team Memebers GET ${graphUrl}/groups/${teamId}/members
Create new Channel
const createChannelRequest: IGraphCreateChannelBody = {
"@odata.type": "#Microsoft.Teams.Core.channel",
displayName: channelName,
description: `This channel is for incident id : ${incidentId}`,
members: membersIds.map(memberId => (
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"[email protected]": `https://graph.microsoft.com/beta/users('${memberId}')`,
roles: ["owner"]
}
))
};
return await graphClient.createChannel(teamId, createChannelRequest);
createChannel is basically POST ${graphUrl}/teams/${teamId}/channels
Create new Tab POST ${graphUrl}/teams/${req.teamId}/channels/${req.channelId}/tabs where channelId is createChannelResponse.id
Create new conversation
const client = new BotConnector.ConnectorClient(credentials, {baseUri: serviceUrl});
const {bot} = TurnContext.getConversationReference(activity);
const createConversationResponse = await client.conversations.createConversation({
bot,
activity: incidentActivity,
members: teamMembers.value.map(member => ({
id: member.id,
name: member.displayName
})),
channelData: {
channel: {
id: newIncidentChannelId
},
tenant: {
id: tenantId
}
},
isGroup: true
});
where createConversation fails with 405
Conversationsobject must have a Direct Line base URI. Can you give us an actual code sample that shows how you're constructing these objects? (Since there are multiple other people in this thread, you will need to @ mention me if you want me to see your reply.) - Kyle Delaney