Just Another Developer
Just Another Developer

Reputation: 518

Conversation in Microsoft Teams

We need to automate few notifications from our web application. These get triggered at various phases, for eg. Step A, B or C would trigger emails to specific parties.

AS an improvisation to this, teams integration is being looked at where a specific channel is being created and with webhook, the messages can be posted.

I created a custom channel with an incoming webhook and I posted a JSON request (of type @messagecard) which was viewable in the channel. But the need is to really establish a conversation and not separate individual messages. By conversation, we mean a scenario or tree structure like below

OverAll status 1 (Parent message) --> subsequent reply (child message) ---> subsequent reply (child message)

I did some R&D and found that the incoming webhook post request does not return any message id (thsi feature doesnt exist)

What I do not understand is how bots (Azure or Microsoft) can help here.

Please advise

Upvotes: 1

Views: 530

Answers (1)

Hilton Giesenow
Hilton Giesenow

Reputation: 10804

Webhooks/connectors is perfectly fine for the single messages, are you're seeing, but I don't think it will give you the ability to create and then continue an existing "conversation" (i.e. a thread). You certainly could achieve something like this using a "bot"-based approach. In practice, it's kind of "bot+extra" because you need two things:

1) A bot registered into the channel. This will give you some key info you need to be able to send messages from outside Teams - something called a "proactive" message. Having the bot in the channel also means you have something with the authorization to send a message to the channel 2) Next you need to implement the Proactive message. Have a look at my answer here to see more: Programmatically sending a message to a bot in Microsoft Teams (the answer is in C# - not sure what language/platform you're using, but the same concepts apply in Node)

In addition to the pro-active message, once you send that first message, you need to store the message reference that comes back from "SendToConversationAsync". You then apply it to the subsequent messages, as I've described in the answer here: How to add a mention in Teams alongside an adaptive card using Bot Framework

Hope that helps

Upvotes: 3

Related Questions