2

I have subscribed a room calendar using graph api and subscribing all the events like Create , Update and Delete.

In my scenario when user invited above room abc@onmicrosoft.com and then cancel original meeting then cancel event get fired in room calendar. two things happen

  1. Instead of getting delete notification , I get update notification. Now, assuming this behavior is due to event has moved to different folder which i am assuming is deleteditems in this case, so its being notified as an update. Can some one confirm if its correct behavior or a bug?

  2. when above event happens the id in the notification response i am getting is same id before the event was cancelled, trying to search the event using above id using graph api for above room abc@onmicrosoft.com.

    var Evt = await graphServiceClient.Users[resourceId].Events[itemid] .Request() .GetAsync();

but here i am getting ErrorItemNotFound error. i am assuming this is due to this event has now moved and its id has now been changed. so seems like id sent by notification is not useful here as did not find any api which can search for deleted events.

My main purpose is to somehow fetch the icaluid of above event, but as we are unable to search it using the id given by above notification.

i tried various methods suggested on other post like searching in delteditems folder, but this also does not provide the icaluid information information i am looking for .

    var myevents = await graphServiceClient.Users[resourceId].MailFolders.DeletedItems.Messages
                         .Request()                                
                         .GetAsync();
                            events = myevents;

and tried to expand it as well to give the vent specific data

    var myevents = await graphServiceClient.Users[resourceId].MailFolders.DeletedItems.Messages
                         .Request()
                         .Expand("eventMessage/event")
                         .GetAsync();
                        

but this gives an error saying

System.AggregateException: One or more errors occurred. (Code: BadRequest
Message: Parsing OData Select and Expand failed: Could not find a property named 'eventMessage' on type 'microsoft.graph.message'

Does anyone know if its possible to get a the particular deleted events data, i searched through various post and it seems like this is still not supported operation.

Let me know if there is any reliable trick can be used to get the data.

Nitin Chopra
  • 129
  • 2
  • 10
  • You may want to try with either the [delta](https://learn.microsoft.com/en-us/graph/api/event-delta?view=graph-rest-1.0&tabs=http) to get a set of events that have been added, deleted, or updated in a calendarView (a range of events) of the user's primary calendar or consider using [Subscriptions/change notifications](https://learn.microsoft.com/en-us/graph/api/resources/webhooks?view=graph-rest-1.0) to see which suits your scenario better. – Dev Apr 04 '21 at 13:14
  • I am already using subscription method , but point is when meeting get cancelled , when I use ID being sent by update notification it can't find the meeting in calendar. main question here is how to get the data for cancelled events as it seems like there is no such api yet which can get such data. – Nitin Chopra Apr 05 '21 at 14:21
  • Can anyone from graph api team answer this? – Nitin Chopra Apr 21 '21 at 22:45
  • whenever the item is cancelled then you will endup seeing the exception item created for it. – Dev Apr 27 '21 at 10:10
  • The scenario here is that I am deleting the whole series, but regardless same thing for single appointment. – Nitin Chopra Apr 28 '21 at 11:15
  • anyone been able to resolve this issue folks? – biso Jul 02 '21 at 08:58
  • As per Microsoft this is working as per design and its unlikely it will change. They have suggested to use immutableids instead.https://learn.microsoft.com/en-us/graph/outlook-immutable-id. Although you still have to store your event information somewhere db/local cache. Main idea is immutableids are more persistent than normal item id. However In certain scenario even immutableids can also change. So far this is the only way. – Nitin Chopra Nov 18 '21 at 23:39

0 Answers0