Link to a personal chat from Task browser

Brass Contributor

I have a bot with commands and messaging extensions.


When I send a card from the Bot as a response for a command received from Teams, I can add a link to the personal chat of the user who sent the command:


linkToPersonalChat: "";


Card text:

         "bla bla: [Open personal chat](linkToPersonalChat)"

And the personal chat is open in Teams client.


However, If I try to open this personal chat from a Task (Messaging Extensions), Teams web is open inside the Teams browser, instead of going diretly to the chat.


Web code:

myElement.innerHtml = "blabla: " + <a href=linkToPersonalChat>Open personal chat</a>


Is it possible to go to the personal chat from a Task web browser?



10 Replies

@diegoSpace What do you mean by a Task web browser? Could you please share some screenshots of the issue?

@Gousia_Begum Thanks for your reply


When I use Messaging Extensions I am receiving a 'FetchTask' event, and I am returning a task with a URL, so a "Teams browser" is open.


In the web page displayed with that URL, I add a text link (<a href=linkToPersonalChat>Open personal chat</a>). I want this link opens directly the personal chat in Teams client (as happens when use a button in a Card sent a channel), but what I see is Teams page in this "Teams browser".


I hope you can understand me




@diegoSpace If you are trying to open the link from a web page you could pass it under microsoftTeams.executeDeeplink('yourdeeplink url'); If you want to open it using a card, please try putting a Action.OpenURL which will directly open the chat with the user.

@Gousia_BegumThanks for your reply.


If I try to use 'microsoftTeams.executeDeeplink' in the web page displayed in a task I get an error: 'microsoftTeams.executeDeeplink is not a function'. However, 'microsoftTeams.tasks.submitTask();' is working


Do I need to add something to use the 'executeDeeplink'?

@diegoSpace Could you please confirm if you have included the script for MsTeams in your web page?

 After adding this you can use it like:

microsoftTeams.executeDeepLink('your Deeplink')

@Gousia_Begum I have this:

<script src=''></script>

(but I have also tried now with the link you provided), but the deeplink does not work for me


Below in my page code I have:

     <script > microsoftTeams.initialize();  </script>


and in the click event of a button I set:

     function onClick() {

But the link does not work. If i paste this link in a channel, it works (private chat is open)


If I use 'microsoftTeams.tasks.submitTask();' it works (event received in my bot), so microsoftTeams API seems to be working...



@diegoSpace Are you trying to deeplink to a chat with the Bot? Could you please share a video recording of the issue you are seeing?

@Gousia_Begum I can not record, but please see my images, which show the problem. In my task I have a page with the link, and when I press it I would like Teams goes to personal channel.


Maybe I could close the dialog with a 'submitTask()', and open the personal chat from bot code. But is it possible?




@diegoSpace Do you have this link inside microsoftTeams.executedeeplink()?

@Gousia_Begum Thanks for your help. I don.t know what I did wrong but now i get it working, with the link inside microsoftTeams.executedeeplink(), as you said... Regards!