3

Let's say person B sends a calendar event invite to person A. When we then run the following query for person A, we can see the event in the response with responseStatus.response="notResponded", which is fine:

https://graph.microsoft.com/v1.0/me/events?startDateTime=2023-01-11T23%3A00%3A01.000Z&endDateTime=2023-01-12T23%3A00%3A00.000Z

However, when person A declines the invitation, then the event disappears from the response.

Is there a way to modify the query or use a different endpoint to still have access to the declined events?

I tried to look for the solution in the MS Graph API docs, but couldn't find any hints.

user2250152
  • 14,658
  • 4
  • 33
  • 57

1 Answers1

1

responseStatus property doesn't support filtering but as an alternative you can use extended property PidLidResponseStatus and filter those events with PidLidResponseStatus equals to respDeclined int value 4.

https://graph.microsoft.com/v1.0/me/events?startDateTime=2023-01-11T23%3A00%3A01.000Z&endDateTime=2023-01-12T23%3A00%3A00.000Z&$filter=singleValueExtendedProperties/any(ep:ep/id eq 'Integer {00062002-0000-0000-C000-000000000046} Id 0x8218' and cast(ep/value, Edm.Int32) eq 4)

But if declined event is remove from the calendar then it cannot be listed.

Documentation:

PidLidResponseStatus

user2250152
  • 14,658
  • 4
  • 33
  • 57
  • 1
    Unfortunately, this doesn't help. I just get an empty list of events... – Dominik Kapusta Jan 12 '23 at 09:39
  • 1
    Though if I go with `cast(ep/value, Edm.Int32) eq 3` then I get accepted events. So the query looks legit, it just seems there's no way to get declined events from MS – Dominik Kapusta Jan 12 '23 at 09:45
  • 1
    Try to use https://graph.microsoft.com/v1.0/me/events?startDateTime=2023-01-11T23%3A00%3A01.000Z&endDateTime=2023-01-12T23%3A00%3A00.000Z&$expand=singleValueExtendedProperties($filter=id eq 'Integer {00062002-0000-0000-C000-000000000046} Id 0x8218') . It will return PidLidResponseStatus extended property and you can check the correct value for declined events. – user2250152 Jan 12 '23 at 09:53
  • 1
    Nope, no luck either :/ – Dominik Kapusta Jan 12 '23 at 10:19
  • 2
    @DominikKapusta If decline event is removed from calendar then it cannot be listed. – user2250152 Jan 12 '23 at 12:02