Dominik Kapusta
Dominik Kapusta

Reputation: 96

MS Graph API - how to retrieve declined events?

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.

Upvotes: 3

Views: 421

Answers (1)

user2250152
user2250152

Reputation: 20843

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

Upvotes: 1

Related Questions