Reputation: 29
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />
</head>
<body>
<div id="bot"/>
<script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
<script>
BotChat.App({
directLine: { secret: direct_line_secret },
user: { id: 'userid' },
bot: { id: 'botid' },
resize: 'detect'
}, document.getElementById("bot"));
</script>
</body>
</html>
I saw this code on github to integrate my bot to my website using the direct line API. I created a direct line channel on azure and copied the direct line secrete key and also my botid, but i dont know what the userid is all about. can someone please help me with this?. I already have my bot hosted as an app on azure
Upvotes: 2
Views: 790
Reputation: 14619
UserId
is the unique identifier of a user inside a conversation, that is to say the Id of the user using this instance of the bot.
This id is not visible to the user (if you set its name), it is the one used to identify resources like specific data (UserData), knowing if a message is from bot or from user, and many other things.
There is also a name
property for this user that you can set and which is used for the webchat display:
user: { id: 'userid', name: 'Name of your user' },
On some channels the value of this id is managed by the channel, on other ones you can set them, like here in Webchat. I made a reply about these Id generation here on StackOverflow.
You can read about main IDs in Bot Framework context in this article of the documentation: ID fields in the Bot Framework
Upvotes: 1