{"id":4510,"date":"2020-05-05T09:08:14","date_gmt":"2020-05-05T16:08:14","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=4510"},"modified":"2020-05-05T09:08:14","modified_gmt":"2020-05-05T16:08:14","slug":"what-is-new-for-change-notifications-and-change-tracking-in-microsoft-graph-may-2020","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/what-is-new-for-change-notifications-and-change-tracking-in-microsoft-graph-may-2020\/","title":{"rendered":"What&#8217;s new for change notifications and change tracking in Microsoft Graph &#8211; May 2020"},"content":{"rendered":"<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/webhooks\">Change notifications<\/a> uses webhooks to let applications to get notified about changes in Microsoft Graph resource data such as Outlook messages or OneDrive files. Change tracking uses <a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/delta-query-overview\">delta queries<\/a> to let applications discover newly created, updated, or deleted entities without performing a full read of the target resource with every request. Over the last few months, the Microsoft Graph team has delivered new capabilities to unlock new change notification and delta query scenarios for our customers.<\/p>\n<h3>Change notification types in SDK (preview)<\/h3>\n<p>We\u2019ve added support for the notification types in the beta SDKs. Now, you don\u2019t have to define a notification collection, a notification, and other complex types with every new project you start that takes advantage of change notifications.<\/p>\n<p>This will reduce the amount of code you need to write and maintain to implement change notifications in your application. For details about how to use these new types in an app, see the <a href=\"https:\/\/github.com\/microsoftgraph\/aspnetcore-webhooks-sample\/blob\/master\/src\/GraphWebhooks-Core\/Controllers\/NotificationController.cs#L82\">NotificationControllers .NET example<\/a>. Try it and <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-beta-sdk-dotnet\/issues\">let us know what you think<\/a>!<\/p>\n<h3>Updated change notifications samples<\/h3>\n<p>Over the past few weeks, we have updated the <a href=\"https:\/\/github.com\/microsoftgraph\/aspnetcore-webhooks-sample\">aspnetcore-webhooks<\/a> and <a href=\"https:\/\/github.com\/microsoftgraph\/nodejs-webhooks-rest-sample\">nodejs-webhooks-rest <\/a>samples, and added a <a href=\"https:\/\/github.com\/microsoftgraph\/java-spring-webhooks-sample\">java-spring-webhooks sample<\/a>. These samples show the following:<\/p>\n<ul>\n<li>How to use change notifications<\/li>\n<li>Use of the latest and greatest platforms<\/li>\n<li>Support for <a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/webhooks-with-resource-data\">change notifications with resource data<\/a> (preview)<\/li>\n<li>Use of the new SDK type for notifications<\/li>\n<li>Support for user-delegated and app-only authentication<\/li>\n<li>Use of the <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/develop\/msal-overview\">Microsoft Authentication Library<\/a> (MSAL)<\/li>\n<li>Use of the <a href=\"https:\/\/github.com\/AzureAD\/microsoft-identity-web\">new Microsoft Identity Web library<\/a> designed to facilitate authentication and authorization when building web applications (.NET only)<\/li>\n<\/ul>\n<p>Check out the sample in your favorite language, learn how to use change notifications, and let us know how we can improve them!<\/p>\n<h3>New extension in community-contributed .NET SDK<\/h3>\n<p>The <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-sdk-dotnet-contrib\">Microsoft Graph .NET contributions SDK<\/a> is a library created by the community and Microsoft jointly. These extensions to the Microsoft Graph .NET SDK can boost your productivity as a developer. Depending on your feedback, some of these extensions will become part of the official SDK.<\/p>\n<p>We have added a new <strong>GetResourceSubscriptionPath<\/strong> extension method to <strong>IBaseRequestBuilder<\/strong>. This allows you to rely on the fluent API provided by the SDK instead of hard-coded strings whenever you are creating new subscriptions for the <strong>Resource<\/strong> property.<\/p>\n<p>You can see this new method in action in the <a href=\"https:\/\/youtu.be\/Y9zUj58BobE?t=284\">recording of the Microsoft Graph community call<\/a> from March 2020.<\/p>\n<h3>Change tracking for new entities<\/h3>\n<h4>v1.0<\/h4>\n<p>Delta query for <a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/api\/application-delta?view=graph-rest-1.0\">applications<\/a> and <a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/api\/orgcontact-delta?view=graph-rest-1.0\">organizational contacts<\/a> is now available in v1.0. You can now track changes for these entities in production apps without having to continuously poll Microsoft Graph.<\/p>\n<p>Replace any existing code that continuously polls <strong>application<\/strong> or <strong>orgContact<\/strong> data by delta query to significantly improve performance.<\/p>\n<h4>Beta<\/h4>\n<p>Delta query for <a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/api\/administrativeunit-delta?view=graph-rest-beta&amp;tabs=http\">administrative units<\/a> and <a href=\"https:\/\/docs.microsoft.com\/en-us\/graph\/api\/oAuth2PermissionGrant-delta?view=graph-rest-beta&amp;tabs=http\">oAuth2PermissionGrant<\/a> is now available in beta. You can now track changes for these entities without having to continuously poll Microsoft Graph. Please note that these capabilities are still in preview. Try them out and give us feedback.<\/p>\n<h4>Example scenario<\/h4>\n<p>Suppose you\u2019re building a native application that allows users to browse contacts. This application offers offline support, meaning that users can browse the contacts from the application when they are not connected to the internet.<\/p>\n<p>Organizational contacts are centrally managed by IT, as opposed to contacts managed by an individual. Organizations can have a single copy of a person\u2019s contact information.<\/p>\n<p>Users have requested that you add support for organizational contacts to your application. Before the availability of delta query for <strong>orgContacts<\/strong>, this would require a complex syncing engine on the client application as well as regular polling of all organizational contacts. With delta query now available, you can support organizational contacts.<\/p>\n<p>To begin change tracking, you <strong>perform an initial round of delta query to synchronize your local store of organizational contacts with the data source<\/strong>. At the end of that round, you save the `deltaLink` so that when the app connects online again, you can use the `deltaLink` to identify the last processed change and proceed to the next round to get any changes that have since occurred.<\/p>\n<p>A deltaLink contains a token that is valid for a limited time. Using an expired deltaLink results in an error, and will require you to start a round of delta query from the beginning again.<\/p>\n<h3>Subscription.Read.All permission generally available<\/h3>\n<p>By default, GET \/subscriptions returns only subscriptions created by the current application. While this satisfies the need for applications to be able to create, list, and maintain their own subscriptions, it was not satisfying for some scenarios, including administrative applications that audit subscriptions, IT pros trying to list out subscriptions with the <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-sdk-powershell\">Microsoft Graph PowerShell SDK<\/a> (preview), and more. Using this new permission, applications can now list out subscriptions created by any application on Microsoft Graph.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Change notifications uses webhooks to let applications to get notified about changes in Microsoft Graph resource data such as Outlook messages or OneDrive files. Change tracking uses delta queries to let applications discover newly created, updated, or deleted entities without performing a full read of the target resource with every request. Over the last few [&hellip;]<\/p>\n","protected":false},"author":69092,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3,128,11],"tags":[53,12,63],"class_list":["post-4510","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","category-microsoft-teams","category-office-add-ins","tag-office-365","tag-outlook","tag-webhooks"],"acf":[],"blog_post_summary":"<p>Change notifications uses webhooks to let applications to get notified about changes in Microsoft Graph resource data such as Outlook messages or OneDrive files. Change tracking uses delta queries to let applications discover newly created, updated, or deleted entities without performing a full read of the target resource with every request. Over the last few [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/4510","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\/69092"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=4510"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/4510\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/25159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=4510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=4510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=4510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}