3

I'm currently using the Microsoft Graph API to sync calendar events to my local application. It seems to be working fine, except I don't seem to be able to retrieve deleted events. I'm following the instructions for the delta query as laid out by Microsoft here. Those instructions specifically say "By using delta query, you can get new, updated, or deleted events in a calendar view," and in the examples there is an event in the sample response that is deleted.

In my testing, however, I am never able to receive any deleted events. I create an event and call /me/calendarView/delta?startDateTime={start_datetime}&endDateTime={end_datetime} and I can see the event. Then I delete the event, make the same call, and the response is empty. I've tried using the deltaToken call, just to be sure I'm getting the events that have changed since my last call, and it does return the deleted event as expected. But I would prefer not to use that, as it requires that my start/end dates always be the same.

Am I just completely missing the point of the delta call, or am I doing something wrong in calling it?

Bobby
  • 119
  • 11
  • I just experienced the same issue. Changes where reflected correctly, except deleted resources did not pop up. The issue was the office.com calendar interface, which had a delay due to an undone action timer. After the undone action timer had run out, the deleted event showed up during the next sync. – Daniel Nov 25 '21 at 15:35

2 Answers2

3

I am using the services as shown here https://learn.microsoft.com/en-us/graph/delta-query-events

GET /me/calendarView/delta?startDateTime={start_datetime}&endDateTime={end_datetime}

And I am not getting the deleted events when running it using the delta token as shown in the example

https://learn.microsoft.com/en-us/graph/delta-query-events#the-next-round-sample-first-request ...

{
    "@odata.type": "#microsoft.graph.event",
    "id": "AAMkADk0MGFkODE3LWE4MmYtNDRhOS04OGQLkRkXbBznTvAADb6ytyAAA=",
    "@removed": {
            "reason": "deleted"
    }
},

...

I always get an empty delta response eg https://graph.microsoft.com/v1.0/me/calendarView/delta?$deltatoken=R0usmcdvmMuZCBYV0hguCFHvWbSXF

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(event)",
    "@odata.deltaLink": "https://graph.microsoft.com/v1.0/me/calendarView/delta?$deltatoken=R0usmcdvmMuZCBYV0hguCFHvWbSXF-PYk6UEH7m4ZdZmSbEIlouKElB10k31BdGZZJ1Os2i",
"value": []
}
avariant
  • 2,234
  • 5
  • 25
  • 33
Nati DWC
  • 31
  • 3
0

You can only obtain deleted items using /delta queries. When calling /calendarView it will give you only the current calendar, not previous iterations of that calendar.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • Thanks for your response. I guess I assumed that the **initial** `/delta` query was also a `/delta` query and should behave the same as all subsequent `/delta` queries. What I'm starting to understand is that the initial query (where I'm passing the dates) is essentially a `/calendarView` query that sets a baseline against which subsequent queries can actually perform a "delta". It's not exactly what I'd hoped for, but it makes sense. – Bobby Jul 25 '18 at 16:58
  • 1
    It is not working . I am using graph explorer for test and i tried all nexlink including deltalink and it is not giving deleted event list – Shyam sundar shah Feb 07 '20 at 16:19