Compartilhar via


Office 365 Graph Developer : Lets use Microsoft Graph Delta Query…

As you aware that Microsoft Graph provides a single API endpoint that gives you access to rich people-centric data and insights, via a number of resources like users and messages. Many applications need to keep track of what’s changing in these data sets, and we recently added support for delta query across a variety of resources on our /beta endpoint to help make that easier. These include Users, Groups, Messages, Mail Folders, Calendar Events, Personal Contacts, and Contact Folders.

So what is Microsoft Graph delta query? This capability enables applications to discover newly created, updated, or deleted resources and relationships without performing a full read with every request. delta query also provides change tracking for relationships between these entities, like changes to a user’s manager and group membership updates.

Here is a video which talks about it in-detail:

Watch this video to learn more about Delta Query, scenarios where it is useful, and how to use it in your applications.

You can try one of the following:

image

Ok, let we try few and burn our hands.

This time let we try specific to messages in the given Inbox folder and see what i notice…

Let me call,

GET https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages/delta/

I see the following response:

{
     "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(message)",
     "@odata.nextLink": "https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages/delta/?$skiptoken=q5iAzeZ8lj7sNlt4pNN8MJIcMDKCWl9cflb41CDbnbtj6s4MQJzos4Fc99nM_6a_OutQ07fNQUeW7Q.DLfr-2TZABSAM-",
     "value": [
         {
             "@odata.type": "#microsoft.graph.message",
             "@odata.etag": "W/\"CQAAABYAAABuW0RzxJhUT4ez5BWQCxI9AABAJ1D1\"",
             "createdDateTime": "2017-06-19T18:04:42Z",
             "lastModifiedDateTime": "2017-06-19T18:04:42Z",
             "changeKey": "CQAAABYAAABuW0RzxJhUT4ez5BWQCxI9AABAJ1D1",
             "categories": [],
             "receivedDateTime": "2017-06-19T18:04:42Z",
             "sentDateTime": "2017-06-19T11:50:56Z",
             "hasAttachments": false,

You can find detailed examples containing series of requests and responses for various resources, along with additional information on using Delta Query in our documentation: 

Hope this helps.