Pages Menu
TwitterRssFacebook

Posted by on Feb 21, 2019 in Development, Microsoft Teams

How to: use a hyperlink to jump directly to a Teams private chat with a user

How to: use a hyperlink to jump directly to a Teams private chat with a user

It’s a fairly common request, from another application, you want to be able to click a button and start a chat with a specific person. Perhaps you want to provide useful contact links to the account manager in your Sales application or integrate your HR intranet to make it easy for people to contact each other.

In Skype for Business, the way to do this was to use a sip address in an anchor link – something like <a href=”sip:[email protected]”>User</a>.  This would open the chat window, from which you could either type an IM or start a call.

It turns out there is a way to do this in Teams. Thanks to Jayesh Gandhi in the Microsoft Tech Community for finding this out, I was not aware of it.

You can construct an anchor tag to jump directly to a Teams chat with a user: <a href=”https://teams.microsoft.com/l/chat/0/[email protected]”>Chat with User</a>.

You can even add multiple people to start a group conversation by separating the users with a comma: <a href=”https://teams.microsoft.com/l/chat/0/[email protected],[email protected]”>Chat with Group</a>.

Even cooler (when adding links in other applications) you can pre-select the message to be sent and the title of the group conversation. The message is added to the conversation input box ready to be sent:

<a href=”https://teams.microsoft.com/l/chat/0/[email protected],[email protected]&topicName=About these widgets&message=Please order more widgets”>Order more</a>

Example:

 

 

These are great features for developers looking to add basic Teams messaging functionality into existing applications. Thanks again to Jayesh for bringing this to my attention!

Written by Tom Morgan

Tom is a Microsoft Teams Platform developer and Microsoft MVP who has been blogging for over a decade. Find out more.
Buy the book: Building and Developing Apps & Bots for Microsoft Teams. Now available to purchase online with free updates.

7 Comments

  1. Thanks Tom for sharing this , its working !!!

  2. Hi ,

    can we add a url in message

    like wise
    var link = ‘‘ + google+ ‘‘;

    var url = ‘msteams:/l/chat/0/0?users=’ + email + ‘&amp;message=Hi ‘ + firstName + ‘, this is regarding ticket: ‘ + link + ‘ – ‘ + short_desc;

  3. Hi,

    can we add a url in message like below

    var link = var incURL = ‘‘ + number + ‘‘;

    var url = ‘msteams:/l/chat/0/0?users=’ + email + ‘&amp;message=Hi ‘ + firstName + ‘, this is regarding ticket: ‘ + link + ‘ – ‘ + short_desc;

  4. Can you please help me creating a link to a team channel with some content in it.

  5. really cool, working fine! thanks

  6. is it possible to have the message sent?

  7. Hi,

    Thanks for this article. It is helpful.
    Is it possible to open chat in an already created Teams Chat group rather than specific user?

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.