SOLVED

Read Teams messages

Occasional Contributor

Hi,

Is there any possibilities to Read Teams messages using C# code? I am tried MSDN Site for this but not being able to find correct information. I would like to extract the message with specific keywords. Is it possible? 

I have gone through some blogs they said it can be but dont know how to and where to start?

 

Regards,

Abhijeet

3 Replies

@abhikhopade2109 

 

You could look at these API's, they are protected, but you can list the messages in a channel https://docs.microsoft.com/en-us/graph/api/channel-list-messages?view=graph-rest-beta&tabs=http

I don't believe there is a way to get a stream of the messages sent to your service as they occur. If you want the users to specify which messages to send you, you can create a bot and when they mention the bot, the message will automatically get sent to your service.

Hi @adamhouck

Thanks a lot for your response.

I dont want to read the stream of messages, but say after office hours I just want to scan through all the messages of the day, including its attachments too. Is it possible?

I am trying to look at the blogs and other sources but couldn't be a help.

best response confirmed by abhikhopade2109 (Occasional Contributor)
Solution

@abhikhopade2109 , As mentioned already. You can make use of beta version List channel messages graph API. you can filter out the result based on time for your requirement.