Read Teams messages

%3CLINGO-SUB%20id%3D%22lingo-sub-1350458%22%20slang%3D%22en-US%22%3ERead%20Teams%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1350458%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EIs%20there%20any%20possibilities%20to%20Read%20Teams%20messages%20using%20C%23%20code%3F%20I%20am%20tried%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fteams-concept-overview%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMSDN%3C%2FA%3E%20Site%20for%20this%20but%20not%20being%20able%20to%20find%20correct%20information.%20I%20would%20like%20to%20extract%20the%20message%20with%20specific%20keywords.%20Is%20it%20possible%3F%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20gone%20through%20some%20blogs%20they%20said%20it%20can%20be%20but%20dont%20know%20how%20to%20and%20where%20to%20start%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EAbhijeet%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1350458%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMeetings%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1351775%22%20slang%3D%22en-US%22%3ERe%3A%20Read%20Teams%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1351775%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F643166%22%20target%3D%22_blank%22%3E%40abhikhopade2109%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20could%20look%20at%20these%20API's%2C%20they%20are%20protected%2C%20but%20you%20can%20list%20the%20messages%20in%20a%20channel%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fchannel-list-messages%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fchannel-list-messages%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EI%20don't%20believe%20there%20is%20a%20way%20to%20get%20a%20stream%20of%20the%20messages%20sent%20to%20your%20service%20as%20they%20occur.%20If%20you%20want%20the%20users%20to%20specify%20which%20messages%20to%20send%20you%2C%20you%20can%20create%20a%20bot%20and%20when%20they%20mention%20the%20bot%2C%20the%20message%20will%20automatically%20get%20sent%20to%20your%20service.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1352353%22%20slang%3D%22en-US%22%3ERe%3A%20Read%20Teams%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1352353%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F567036%22%20target%3D%22_blank%22%3E%40adamhouck%3C%2FA%3E%3C%2FP%3E%3CP%3EThanks%20a%20lot%20for%20your%20response.%3C%2FP%3E%3CP%3EI%20dont%20want%20to%20read%20the%20stream%20of%20messages%2C%20but%20say%20after%20office%20hours%20I%20just%20want%20to%20scan%20through%20all%20the%20messages%20of%20the%20day%2C%20including%20its%20attachments%20too.%20Is%20it%20possible%3F%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20look%20at%20the%20blogs%20and%20other%20sources%20but%20couldn't%20be%20a%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1357098%22%20slang%3D%22en-US%22%3ERe%3A%20Read%20Teams%20messages%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1357098%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F643166%22%20target%3D%22_blank%22%3E%40abhikhopade2109%3C%2FA%3E%26nbsp%3B%2C%20As%20mentioned%20already.%20You%20can%20make%20use%20of%20beta%20version%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fchannel-list-messages%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%26amp%3BviewFallbackFrom%3Dgraph-rest-1.0%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EList%20channel%20messages%3C%2FA%3E%20graph%20API.%20you%20can%20filter%20out%20the%20result%20based%20on%20time%20for%20your%20requirement.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted

@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.

Highlighted

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.

@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.