{"id":7758,"date":"2021-10-01T12:09:11","date_gmt":"2021-10-01T19:09:11","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/?p=7758"},"modified":"2021-11-15T15:55:12","modified_gmt":"2021-11-15T23:55:12","slug":"announcing-general-availability-of-microsoft-graph-export-api-for-microsoft-teams-messages","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/announcing-general-availability-of-microsoft-graph-export-api-for-microsoft-teams-messages\/","title":{"rendered":"Announcing general availability of Microsoft Graph Export API for Microsoft Teams messages"},"content":{"rendered":"<h4 class=\"x-hidden-focus\">Exporting Microsoft Teams content with Microsoft Graph Export API<\/h4>\n<p>Today, we are thrilled to announce the general availability of Microsoft Graph Export API, that enables customers and ISVs to export Microsoft Teams message data for processing in their Security and Compliance (S+C) SaaS applications.<\/p>\n<p>Organizations need the ability to manage and archive information so that regulatory and legal requirements are met. With the adoption of Microsoft Teams by regulated customers, there is a growing demand by S+C SaaS providers to access Teams messages and message hosted content (files, images, stickers etc.) that are shared in 1:1 or group chat, channel conversations, and Teams meetings. Microsoft Graph Export API for Teams supports exporting Teams messages and message hosted content for a particular user or team that is subject to compliance. Deleted messages are also accessible by the API for up to 21 days after they are deleted.<\/p>\n<p>There are two options for using the API \u2013<wbr \/>\u00a0one is designed for S+C scenarios and the other is designed for more all-purpose scenarios other than S+C. S+C scenarios require an E5 license which provides a seeded capacity to use the API without consumption cost until the seeded capacity is reached. For all other scenarios, there are no specific license requirements, and the API is charged per message exported. For additional details, please see below.<\/p>\n<h4>Why Export API?<\/h4>\n<p>Some of the critical scenarios powered by Export API are:<\/p>\n<ol>\n<li><strong>Retrieve Teams content<\/strong><\/li>\n<\/ol>\n<p>Export API allows applications to export all messages of a specific team for a defined period of time. Teams Message retrieval includes new, updated, and deleted messages and its hosted content. Messages will be exported from all public and\/or private channels of the requested team under compliance.<\/p>\n<ol start=\"2\">\n<li><strong>Retrieve content for regulated users<\/strong><\/li>\n<\/ol>\n<p>Export API allows applications to export all messages of a specific user for a defined period of time. User Message retrieval includes new, updated, and deleted Messages and its hosted content. Messages will be exported from all 1:1\/group chat threads participated for the requested user under compliance<\/p>\n<ol start=\"3\">\n<li><strong>Bulk export of Teams messages<\/strong><\/li>\n<\/ol>\n<p>Export APIs support up to 200 RPS per app per tenant and 600 RPS for an application. These limits enable partners to retrieve historical content and be able to bulk export of Teams messages.<\/p>\n<ol start=\"4\">\n<li><strong>Retrieve user deleted messages<\/strong><\/li>\n<\/ol>\n<p>Messages that are deleted by users from the Teams client can be accessed using Export APIs up to 21 days from the time of deletion.<\/p>\n<p>For more information, refer to the\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoftteams\/export-teams-content\">documentation<\/a>\u00a0on Export APIs.<\/p>\n<h4>Examples of Export APIs<\/h4>\n<p>Here are some examples on how you can use the Export APIs<\/p>\n<p><strong>Example 1:<\/strong>\u00a0If you have enabled Microsoft Teams in your organization and want to export all the Teams messages to date of a user or a team without any filters, call the API as shown below:<\/p>\n<pre class=\"lang: decode:true \">GET https:\/\/graph.microsoft.com\/v1.0\/users\/{id}\/chats\/getAllMessages<\/pre>\n<pre class=\"lang: decode:true\">GET https:\/\/graph.microsoft.com\/v1.0\/teams\/{id}\/channels\/getAllMessages<\/pre>\n<p><strong>Example 2:<\/strong>\u00a0If you have enabled Microsoft Teams in your organization and want to export all the Teams messages of a user or a team by specifying date time filters and top 50 messages, call the API as shown below:<\/p>\n<pre class=\"lang: decode:true \">GET https:\/\/graph.microsoft.com\/v1.0\/users\/{id}\/chats\/getAllMessages?$top=50&amp;$filter=lastModifiedDateTime gt 2020-06-04T18:03:11.591Z and lastModifiedDateTime lt 2020-06-05T21:00:09.413Z<\/pre>\n<pre class=\"lang: decode:true\">GET https:\/\/graph.microsoft.com\/v1.0\/teams\/{id}\/channels\/getAllMessages?$top=50&amp;$filter=lastModifiedDateTime gt 2020-06-04T18:03:11.591Z and lastModifiedDateTime lt 2020-06-05T21:00:09.413Z<\/pre>\n<h4>How to access Microsoft Teams Export APIs<\/h4>\n<p>Export APIs require application permissions and consent before you can use them. The following permissions are needed:<\/p>\n<ul>\n<li><em>Read.All<\/em>: enables access to all 1:1, Group chat, and meeting chat messages<\/li>\n<li><em>Read.All<\/em>: enables access to all channel messages<\/li>\n<li><em>Read.All<\/em>: enables access to the list of users for a tenant<\/li>\n<\/ul>\n<p>To request access to Export APIs, complete this\u00a0<a href=\"https:\/\/aka.ms\/teamsgraph\/requestaccess\">request form<\/a>. Requests made by Wednesday every week, will usually get processed in the same week.<\/p>\n<h4>License requirements for Microsoft Graph API for Teams Export and DLP<\/h4>\n<p>We are announcing new seeded capacity as an E5 value for S+C applications, and consumption models for the following S+C APIs:<\/p>\n<ul>\n<li>Microsoft Graph Change Notifications API for Teams notifications<\/li>\n<li>Microsoft Graph Export APIs for Teams messages<\/li>\n<li>Microsoft Graph Patch API for Teams messages<\/li>\n<\/ul>\n<p>Seeded capacity is how much an app can use before having to pay usage fees. Teams S+C APIs include two modes of access, one for S+C applications and one for general usage. Seeded capacity applies to S+C mode only (Model = A). Once the customer exceeds seeded capacity, consumption meters will kick in. The general usage mode will only use consumption meters and will not have any seeded capacity (Model = B). Consumption meter charges for API usage beyond available seeded capacity will be enabled in CY22, and a 30-day notice will be provided before these charges are in effect. Customers can review which apps are accessing their data through the S+C API in the Teams Admin Center. Once meters are in effect, the report will show their usage against their seeded capacity.<\/p>\n<p>Additionally, we will begin enforcing the previously communicated license requirements for these APIs. Existing customers as of October 5th, 2021, will get a six-month grace period to assign users with the proper license. However, all new customers after October 5th, 2021, will be required to have an appropriate E5 license<sup>1<\/sup>\u00a0to allow access to Teams messages via the Teams S+C APIs.<\/p>\n<p><sup>1<\/sup><span class=\"brand\">Microsoft 365<\/span>\u00a0E5\/A5\/G5,\u00a0<span class=\"brand\">Microsoft 365<\/span>\u00a0E5 Security,\u00a0<span class=\"brand\">Microsoft 365<\/span>\u00a0E5 Compliance,\u00a0<span class=\"brand\">Microsoft 365<\/span>\u00a0E5 Information Protection and Governance,\u00a0<span class=\"brand\">Microsoft 365<\/span>\u00a0E5 Information Protection &amp; Data Loss Prevention<\/p>\n<h4>S+C Scenarios (Model=A)<\/h4>\n<p>Restricted to applications performing a security and\/or compliance function (A few examples but not limited to: Data loss prevention, eDiscovery, Compliance Archiving etc.). Users must have specific E5 licenses to use this functionality and receive seeded capacity. We are adding seeded capacity per user, calculated per month, and aggregated at the tenant level. For usage beyond the seeded capacity, app owners will be billed for API consumption.<\/p>\n<p>Model A can only access messages from users with an assigned E5 license.<\/p>\n<h4>General Usage Scenarios (Model=B)<\/h4>\n<p class=\"x-hidden-focus\">Available for all non-S+C related scenarios. There are no license requirements and there is no seeded capacity. When consumption meters become available, app owners will be charged for all API calls they make monthly.<\/p>\n<p>A few scenario examples, but not limited to: Teams Backup, Analytics &amp; BI, Sentiment Analysis applications etc.<\/p>\n<h4>Evaluation Mode (default)<\/h4>\n<p>No model declaration enables access to APIs with limited usage per requesting application for evaluation purposes.<\/p>\n<p>For more information about seeded capacity and consumption fees, please visit\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/teams-licenses\">Licensing and payment requirements for Microsoft Graph Teams APIs.<\/a>\u00a0To learn more about Export API, please visit\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoftteams\/export-teams-content#how-to-access-teams-export-apis\">Export API documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Graph Export API for Teams supports exporting Teams messages and message hosted content for a particular user or team that is subject to compliance.<\/p>\n","protected":false},"author":69077,"featured_media":6844,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3,128],"tags":[],"class_list":["post-7758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","category-microsoft-teams"],"acf":[],"blog_post_summary":"<p>Microsoft Graph Export API for Teams supports exporting Teams messages and message hosted content for a particular user or team that is subject to compliance.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/7758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69077"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=7758"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/7758\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/6844"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=7758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=7758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=7758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}