Initiate Microsoft Teams chat using custom URLs

Hyperlinks to initiate a chat with your friends/coworkers on Microsoft Teams

Let this be a simple hack for all you developers out there to initiate Microsoft Teams chat with your desired friends or coworkers using a hyperlink.

Magic URL

Our magic URL is

https://teams.microsoft.com/l/chat/0/0?users=<PARTNERS_EMAIL_ADDRESSES_SEPARATED_BY_COMMA>

Example:

A link to open Teams chat with user accounts associated with email addresses and

https://teams.microsoft.com/l/chat/0/0?users=a@example.com,b@example.com

This link opens a Teams page on your browser which requests you to allow it to open Microsoft Teams on your machine. It looks like this:

image.png

Clicking "Open Microsoft Teams" takes you to a Teams window and opens a chat with the entered email addresses provided they are valid, available and you are permitted to chat with them on Teams.

Main Use-case

I have found its best use in a Support button on PoC (Proof of Concept) applications released inside our organization to allow our trial members to reach all of the developers in case the application runs into trouble or if they want to provide a quick feedback to us.

You can provide a button on the top right of your application like below and add an "onClick" event listener to open a customized Teams link

image.png

Your code to open this link on Javascript will look like this

window.open("https://teams.microsoft.com/l/chat/0/0?users=a@example.com,b@example.com")

Other Use-cases

  1. Create a bookmark on your browser to open Teams chat with people you frequently talk to
  2. Create a Teams button on your school homepage to allow your schoolmates to talk to you directly
  3. Create support buttons on internal grievances portal in colleges and offices to allow people to directly talk to the concerned representative on Teams

Can you think of any other use-cases? Do let us know!