1

I need to get all messages from Microsoft Team chats. Looks like Chats are stored in the Teams Storage, but their content is somehow duplicated in Exchange so you have a hidden folder called Conversation History\Team Chat where you see these conversations then. So I think that it should be something like a shared mailbox or other storage with special address to access these messages and it should be a possibility to fetch them as those from normal mailbox. But I didn't find any possibility to get them by using Exchange Web Services.

There are some basic functionality for working with Team Channels and Chats in MS Graph API but set of available endpoints is currently incomplete (e. g. We can only create chat threads but can`t fetch them. Also there is no possibility to get or create separate chat messages in API). Moreover these endpoints are under the /beta version in Microsoft Graph and are not recommended for usage:

Important: APIs under the /beta version in Microsoft Graph are in preview and are subject to change. Use of these APIs in production applications is not supported.

How can I get all Microsoft Team Chat messages using EWS API?

Vasyl
  • 404
  • 1
  • 6
  • 19

2 Answers2

3

The Graph API for reading Teams conversations is not yet available but should be in couple of weeks.

Wajeed Shaikh
  • 3,078
  • 1
  • 23
  • 30
  • I am aware of it and mentioned this above. I would like to know how can I use EWS API to get Team Chat messages. My question is relate to this. – Vasyl Jul 23 '18 at 13:26
  • I found new endpoints for Microsoft Teams Channels in MS Graph API **/beta** version recently. Suppose the same featured will be added to **/1.0** as well. – Vasyl Sep 07 '18 at 08:09
2

Microsoft Teams does not store conversations in Microsoft Exchange. As such, they are inaccessible using Exchange Web Services.

The only API for accessing Microsoft Teams data is Microsoft Graph. As noted, this API set does not support reading conversations from a Channel just yet. See Wajeed's answer for the ETA.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • My assumptions are based on [this post](https://techcommunity.microsoft.com/t5/Microsoft-Teams/Where-do-conversations-get-stored/td-p/31670). And by the way I can get email address of the channel and than use EWS for fetching data related to this channel email. Does it make sense? – Vasyl Jul 24 '18 at 09:50
  • Be careful not to confuse conversations in Microsoft Teams with conversations in Outlook Groups. Microsoft Teams is built on top of Groups but they do not share the same conversations/channels. You can obtain a Group Conversation but this is not the same as a Channel Conversation or Chat. – Marc LaFleur Jul 24 '18 at 14:06
  • 2
    APIs to read messages from a Teams channel are now in preview. Here's a.NET Core application that demonstrates its use. You download messages from one channel or from all channels in a Team: https://github.com/tamhinsf/QuickTeams Here are the underlying APIs that it uses: To read the messages in a given channel. This will return a paginated list of messages, each with a unique ID. https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/channel_list_messages https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/channel_list_messagereplies – Tam Huynh Aug 08 '18 at 00:04