I want to uniquely identify users in Web Chat and store information particular to the user.
As far as I know Web Chat does not support channel data, so is there any way to identify users?
Can anyone help me on this issue?
The activity that your bot receives and send contains a From and a Recipient property that you can inspect to get details about the user, including the Id.
Related
I'm building my first Teams app which will have two primary functions:
Proactively send a message to the channel (the bot is installed into) when a specific event occurs on my backend.
Members of the channel reacts to the message via actions.
I finally have a pretty good idea of how to set this up (I think) - but one part I'm missing is that in order to identify the specific app installation as belonging to one of my customers, I need to be able to allow the installing user to supply extra information like e.g. an API-key so that I can associate the specific channel with my specific customer.
Is there any way of doing this with a bot app? I've found examples for creating a configuration page, but they all seem to be associated with tab apps?
I could of cource have the bot ask the user for the information - but maybe there's a "cleaner" way?
Any examples or tutorials would be greatly appreciated as I find it rather hard to get stuff working using Microsoft's own examples etc. :)
Thanks a lot!
When you receive any message from the user, either by typing to your bot, or even installing it into a channel, group chat, or personal context (where you get the conversationUpdate event), you are able to get specific details off of the activity object. If the user sends a message, for instance, then the text property on the activity object will have a value. Incidentally, this is the same activity you will use to get the conversation details you need for the Proactive message.
With regards your question, the activity class also includes a tenantId property, hanging off the conversation property. This is the unique Microsoft 365 Id for the tenant, which would be what I'd suggest to uniquely identify them for your API, or licensing, or similar.
I'm building a Skype bot using Microsoft's framework and I want to recognize the users.
can anyone give suggestions on how to do it? The users should be recognized in order to give them authorization for tasks the bot preforms so it must be something that never changes and can be stored on a database.
The only thing I saw was "ServiceUrl".
thanks!
You can get the unique user id like below:
var userId = Context.Activity.From.Id;
This will always give you the user ID of the channel they reside on. In your case it will be their Skype ID.
I developed a welcome bot using the Microsoft Bot Framework. I want to add it to Teams. In teams I want the bot to send welcome messages to only certain members belonging to a particular team or group. Please provide me advice or steps how to do it.
You can only send a welcome message to a specific user if that user first contacted your bot. This is done purposefully to minimize the possibility of spam bots being created. Once a user has contacted your bot you can capture the user's Id and, coupled with the conversationId, you can send future (proactive) messages.
I'm able to open Teams chat with a specified contact using 'sip:example#emailaddress.com' but 'msteams:example#emailaddress.com' only opens the application; it does not open chat with the specified individual.
Is there, or will there be, a scheme which allows for opening chat with an individual using the 'msteams:' uri similar to 'skype:example#emailaddress.com'?
Updated answer
try this Teams Chat
This will open a private conversation with the user in ms teams
Currently this is not supported for Microsoft Teams but it's on our roadmap.
https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links
Find the Chat deeplink, and embed elsewhere.
Example: With one or more users can be specified.
Example: https://teams.microsoft.com/l/chat/0/0?users=joe#contoso.com,bob#contoso.com&topicName=Prep%20For%20Meeting%20Tomorrow&message=Hi%20folks%2C%20kicking%20off%20a%20chat%20about%20our%20meeting%20tomorrow
The query parameters are:
users The comma-separated list of user IDs representing the participants of the chat. The user performing the action is always included as a participant. The User ID field currently only supports the Azure AD UserPrincipalName (typically an email address).
topicName An optional field for chat's display name, in the case of a chat with 3 or more users. If this field is not specified, the chat's display name will be based on the names of the participants.
message An optional field for the message text that you want to insert into the current user's compose box while the chat is in a draft state.
Note that the link will only open a chat if the users are in your tenant. For federated users it will only open if you previously had a chat window with them.
Let's think of the following example:
1) I have a certain bot deployed on Azure
2) Bot can be talked via Facebook Messenger and via Skype
3) A certain user talks to the bot via Facebook Messenger and then he leaves.
4)A couple of minutes ago the same user resumes the conversation with the bot, but via Skype.
Is this possible? I assume Bot Framework doesn't have anything included for this, hence, that this isn't posible (as conversations are independent and state changes depending on the channel). Is there any way to identify a user (via some authentication method maybe), and then making this logic again?
Do any of you know any workaround for this?
Thanks in advance!
The Bot Framework Connector service is a component which provides a single API for your bot to communicate across multiple client services such as Skype, Email, Slack. Every bot and user has an account within each channel.
The channel account contains an identifier (id) and other informative bot non-structural data, like an optional name.
And there us unique conversation ID created for each conversation of each user for each channel. And you can customize your channel capabilities as described here.
Regards,
Jyo