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.
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'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
we have an app for MS Teams which users can start a conversation and send messages to. The app does some processing and returns the response back. I am looking for the ability to open an precreated conversation using a link. I have needed information like conversation id etc. How do i create a link that can be used for this navigation?
To be more specific this doc is not helpful https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links#deep-linking-to-a-chat
The link i need is for the conversation. Currently it is possible to manually copy that link by right clicking on any conversation and use "Copy link". Is there a way to get it or generate it when user creates the conversation. A sample link copied from looks like below
https://teams.microsoft.com/l/message/19:a0a0088174a644cb91409f4d8f79d888#thread.tacv2/1612324568748?tenantId=04e930f3-0866-4a6d-b07c-a4737e8f9865&groupId=087bf290-deb5-4790-b159-bf86914765b4&parentMessageId=1612324568748&teamName=Sales%20Team&channelName=FlashCX%20Sales&createdTime=1612324568748
So trying to see if i can either get this the URL using apis or can generate with the parts involved
#Moblize - Currently you can create Deep-link to chat for particular conversation. You cannot create a link which will redirect to a particular message in channel. Please check this docs for info.
I am new to Microsoft bot framework and have seen the term turncontext many times.
Can some one explain what that actually means and its significance.
eg: turncontext(adapter,activity)
When using a bot, the user and the bot take it in turns to speak. Within the Bot framework a turn is a users incoming activity which the bot responds too. Every message a bot receives from a new user will be in a new turn.
If the user asks a question "What is the weather like today?", the bot may respond with "Where would you like the weather for?". That is all in one turn. The user then responds with "London", this is in a new turn.
The turnContext is the object that gives you access to the information about the current turn from the user. This includes the current message sent by the user among for example. For a full specification see here. It's also used to send messages back to the user, SendActivityAsync is one to do this.
Take a look at this Microsoft article I used as the basic of this answer which goes into way more detail. Also take a look through the Bot Framework Samples and step through the code to learn more about the turnContext.
I would like to implement the following Scenario:
Within a Meeting that should take place in the real world in a room (not necessarily within MS Teams), I want a Microsoft Azure Chat bot to post a message to the meeting-chat, without someone having to add the bot to that meeting chat.
I noticed, that real proactive messaging to MS Teams is still not possible, a workaround is necessary: Catching a conversation reference including the users teams-chat-id while he adds the bot e.g. via personal teams app. This works good, if the teams app is pushed to all users within an organization via policies.
This workaround however is not possible within a meeting-chat, that might not exist at the time the bot should write to it. So, no possibility to catch a conversation reference to post to.
Also, I noticed that there does not even exist a MS Graph endpoint neither a connector within Logic apps to post a teams message to several users without cannel-context.
Do you see any workaround for this scenario, or is it simply not supported?
To my knowledge, you're right on both accounts - a bot can't proactively message a chat that it's not part of, and I don't think Graph supports messaging to group chats altogether, which is your scenario.
Just on a point of correctness though, a bot can proactively message (a) individual users (1-1), (b) group chats, and (c) Team channels, each separately (i.e. it does not need to be installed by each user, and message each user privately, unless that is the desired scenario. All that's required for each of these is the relevant "conversationid" that represents the specific conversation, and the ServiceUrl.