Launch Teams chat with particular contact using msteams URI scheme - microsoft-teams

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.

Related

Microsoft Teams Redirect URL to a Thread or Group Conversation

I've been using the next URL to redirect any user to their private chat with our MS Teams App:
https://teams.microsoft.com/l/chat/0/0?users=28:b9cc7986-dd56-4b57-ab7d-9c4e5288b775
with b9cc7986-dd56-4b57-ab7d-9c4e5288b775 being the App Id of out bot (sample App Id in this case).
This URL will open the private MS Teams Chat with the user clicking the URL and our App on any client (Mobile, Desktop, Browser) without opening any web pages if not needed. The clients can handle the URL themselves. You can try it with this provided sample URL.
What would be a proper way to be able to redirect to a group conversation or thread?
I've thought about using the Conversation Id (or other Ids available in our MS Teams App) or something but couldn't find any good documentation or examples online.
You can use Deep Links to accomplish that, specifically deep linking to a chat. As shown in that link, you can link to specific users, but also set a conversation topic as well as an initial message. One thing that's often overlooked, just fyi, is this sentence:
New chats are created in draft state until the user sends the first message

External link to existing Microsoft Teams chat

I have developed a Microsoft Teams app, and I'm using 'deep linking' to create named chats (chats with topic names) with selected users, as per the docs:
https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links#deep-linking-to-a-chat
An example of a 'deep link' to create a chat would be:
https://teams.microsoft.com/l/chat/0/0?users=joe#contoso.com,bob#contoso.com,dave#contoso.com&topicName=Prep%20For%20Meeting%20Tomorrow&message=Hi%20folks%2C%20kicking%20off%20a%20chat%20about%20our%20meeting%20tomorrow
This works fine - and if I save the portion of the link minus the 'message' portion, this again works fine, and links the user to the existing chat:
https://teams.microsoft.com/l/chat/0/0?users=joe#contoso.com,bob#contoso.com,dave#contoso.com&topicName=Prep%20For%20Meeting%20Tomorrow
However, if another user is added to the chat from inside Teams itself, the link above will not link to the existing chat any more, rather create a brand new chat instance with the same topicName and originally specified users.
Is there a way of 'deep linking' to a chat by it's topicName or some kind of ID only? Without having to get clever with the Microsoft Graph API?
https://teams.microsoft.com/l/chat/0/0?Prep%20For%20Meeting%20Tomorrow
just links to the chat 'home screen', where a user can start a new chat through Teams
I might be wrong, but I'm pretty sure you can't achieve this directly. As soon as you add a new person, it's no longer the "same" chat, so to speak (e.g. a chat with "Joe, Bob and Dave" is NOT the same as a chat with "Joe, Bob, Dave and Sue". The two ways I can think of that you can achieve what you're looking for though, are:
create a Meeting with that subject - the "meeting" chat seems to hang around forever, it has a title, and you can modify participants, even after the "meeting" is over.
Alternative to the above, if there's an ongoing initiative, maybe it's just better as an actual Team or Channel anyway...?
I came here looking a solution to this same requirement.. a link that others can click on to dial into a normal MS Teams (multi-person) chat. I want to include this in my meeting invites in the case where I initially created the chat group manually within MS Teams (not originally via meeting invite).
I opened the chat in MS Teams Web (in my browser) to get the unique conversation identifier and then replaced that portion in a sample link that I would typically find in meeting invites. I also removed the context parameter. When I followed the resulting link in my browser it launched my MS Teams desktop application and joined the chat group meeting. An illustrative sample link is below:
https://teams.microsoft.com/l/meetup-join/*19:1235774810bf4d7086ada8e13c7c6c8a#thread.v2/0*
The portion "19:1235774810bf4d7086ada8e13c7c6c8a#thread.v2/0" is what I replaced.
And there is no need for something like "?context=%7b%22Tid%22%3a%22c9b9cb50-3544-4db4-a267-fa84df2f4ceb%22%2c%22Oid%22%3a%22663db54f-657a-407d-8a0b-45c76d8cdffd%22%7d" at the end either. I'm not sure what will happen if someone uses this link who has not been added to the chat by me though. You'll have to test that if that is a requirement.

Sending context information to chatbot

While launching a web chat bot from a portal (through iframe), is it possible to send the details of the logged in user (who has already logged into the portal) to the bot and save it in the bot state so it can retrieved inside the bot code to do some customization or apply custom logic based on the user details. User details can include their name, date of birth, gender etc.
Your web app and bot can exchange information "behind the scenes" (i.e., invisible to the end-user) by exchanging activities of type event. An activity with type event will not be displayed by clients such as Web Chat, so the end user won't see any evidence of the communication. This type of communication between client and bot is sometimes referred to as the "backchannel mechanism."
For an example of how this is done, check out Ryan Volum's backchannel sample bot.

Find the address of a specific user using Microsoft bot-builder

I would like to open new conversations with users using the Microsoft Bot Builder on the Skype for Business channel. The only information I have is the user id (sip:user#domain.com)
In all the examples I could find, it is needed to save the conversation id/address of a user in a previous conversation to send a new message to this user.
How to create a new conversation as a bot to a user knowing only his id?
Thanks
Like you stated the userId is required to send a message to the user. A new conversation can be created by the framework but ultimately, you can't do anything without the userId and to obtain this the user has to contact your bot first. This is only true for channels like Skype. Other channels like E-mail just use the email address as an id. Skype uses a GUID as the id for their users. This is done so bots can't randomly add themselves to any user on Skype. Source
This doesn't mean you have to necessarily wait for the user to start a conversation. Whenever a user adds a bot to their contact list an event is send to the bot. This is the ContactRelationUpdate event. It warns the bot that a user has added the bot and the bot can then respond accordingly. Once this event is thrown you can obtain the userId from the activity and do whatever you want with it. Source

Uniquely identify user in Microsoft Bot Framework Web Chat

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.

Resources