Search code examples
botsbotframeworkmicrosoft-teamschatbotdeep-linking

Microsoft Teams - Send Message To Bot Via Deep Link


I'd like to start a conversation with a Bot with a prepopulated message via a Deep Link (encoded in a QR Code).

I can Deep Link to a chat with the Bot:

https://teams.microsoft.com/l/entity/<appId>/conversations

And I can start a chat with an prepopulated message:

https://teams.microsoft.com/l/chat/0/0?users=<user@domain.com>&message=This%20message%20was%20triggered%20by%20a%20link!

But I can't find a way to include a message to a bot?


Solution

  • It's possible to do this by using the bot's Id instead of an email address, with a "28:" at the beginning, something like this:

    https://teams.microsoft.com/l/chat/0/0?users=28:[your bot guid here]&message=This%20message%20was%20triggered%20by%20a%20link!
    

    the id to use here would be the one in your manifest in the botId attribute.

    Note that, as with the deep link you posted above, this doesn't actually send the message to the bot, it just pre-loads it into the chat text box - the user still needs to click the send button (or hit Enter).