Croy
Croy

Reputation: 261

Microsoft graph delta query documentation clarification

I am going through documentation for Microsoft Graph https://learn.microsoft.com/en-us/graph/delta-query-events?tabs=java and found that section "The next round: sample first request" doesn't include delta query as part of request in which case the current state meaning all the events should be returned.

Also, I see that the same request has no start or end date. I am aware that this call is being made using the deltaToken received in last call. So, should start and end Date be passed while making a call where I am using deltaToken to fetch the next set of changes?

Below is the code used in Documentation(Neither deltaToken is included nor Start and End date):

IGraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();

LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new HeaderOption("Prefer", "odata.maxpagesize=2"));

IEventDeltaCollectionPage delta = graphClient.me().calendarView()
    .delta()
    .buildRequest( requestOptions )
    .get();

Please help. Thanks in advance.

Upvotes: 1

Views: 922

Answers (1)

baywet
baywet

Reputation: 5372

Any query parameter provided in the initial Delta query will be encoded in the Delta or skip token, this is why you don't need to pass it every time. (Start and end dates)

There seems to be an issue with this documentation page, it's never showing to use the Delta link and passing it back as a Delta token query parameter (similar to what's done with the skiptoken). I'll PR the docs tomorrow to get that fixed.

Upvotes: 1

Related Questions