Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send a reply to a message older message via a Incoming Webhook to Microsoft Teams

I'm trying to send a reply to older message that I sent to Microsoft Teams, but till now i couldn't manage to do that. To send a message to Teams I'm creating a message which looks as following: First of all I've got a model with is holding the data:

public class WebHookContent
{
    public string Text { get; set; }
    public string Title { get; set; }
    public string Color { get; set; }
}

Adding data to the model as following:

WebHookContent content = new WebHookContent();
content.Title = "ALERT";
content.Text = "Sometext";
content.ThemeColor = "F00505";

So now that I've got my message I send this to Teams with a HttpClient which looks like this:

HttpContent data = new StringContent(JsonConvert.SerializeObject(content));
HttpClient client = new HttpClient();
await client.PostAsync(webHookUrl, data);

With that the message is sent to Teams and that was the easy Part but now I'm lost on how to send a reply to exactly this message which I just sent.

My thought was that probably this message has like an ID which I could store in my database. And somehow with that ID I could reply to this message.

Is that correct?

What are your thoughts? How would you do it?

like image 380
Mike Avatar asked Oct 28 '22 21:10

Mike


1 Answers

In order to have a two-way conversation with Teams you'll need to use a bot. To get started check out the documentation here: https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-overview

like image 154
Andrew Clear Avatar answered Nov 15 '22 05:11

Andrew Clear