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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With