2
votes

Use case: I am interested in tracking changes to a user's messages and events.

Using delta query (https://developer.microsoft.com/en-us/graph/docs/concepts/delta_query_overview) I can achieve this, but I need to send two requests against the Graph: one for messages, one for events.

Batching (https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching, currently preview) allows me to send multiple requests at once, and neither the known issues (https://developer.microsoft.com/en-us/graph/docs/concepts/known_issues#json-batching) nor the OData spec indicate that batch-sending deltaLinks would be disallowed.

Is this a supported scenario or am I trying to mis-use either Batch or Delta Query?

1

1 Answers

1
votes

We do not do anything special in batching for Delta requests currently. If you want to send multiple delta queries you can send it inside a batch request by calling “/version/$batch”. The batch response would contain individual responses, each with its own nextlink/deltalink. Clients can then parse this response, extract the nextlink, create a new request with the nextlink and put this inside another batch request or send as an individual request. Here is the example of using a delta request inside a batch :

POST /beta/$batch HTTP/1.1
{
  "requests": [
    {
      "url": "/users/delta?$select=displayName,givenName,surname",
      "method": "GET",
      "id": "1"
    }
  ]
}
Host : graph.microsoft.com

Reference : https://developer.microsoft.com/en-us/graph/graph-explorer?request=$batch&method=POST&version=beta