Reputation: 1085
I have built a bot service in Azure. And currently, I am also testing in the test webchat in Azure portal.
What I need to know is how in this conversation (or via the botbuilder sdk) do I find the conversation ID.
I have a separate script that wants to send messages via directline to this already open conversation in Azure Portal but it needs the conversation ID.
Nowhere in the code for my bot does it specify starting a conversation either - it listens via the builder.UniversalBot(connector).
I know how to start and have a conversation all via directline with this bot. But I would like to start a conversation in the webchat in the Azure portal, find the conversation id and then use that in the other script I have to post messages to that same conversation.
Presumably, when I start a conversation by messaging in the webchat, there is a conversation started?
Help here would be greatly appreciated!
Upvotes: 1
Views: 1359
Reputation: 8292
You can find the conversation id in the Network tab of Chrome's developer tools:
Another option is to just have the bot show the conversation id:
bot.dialog('/', function (session) {
if(session.message.text == 'get conversationid')
session.send('conversation.id: ' + session.message.address.conversation.id);
else
session.send('You said: ' + session.message.text);
});
Upvotes: 4