Group Delete Notification doesn't work

Mark Babayev 226 Reputation points
2021-02-08T11:53:48.803+00:00

I want to be notified by the event when some Exchange Server group is deleted.
I'm creating the subscriptions as described in manuals: https://learn.microsoft.com/en-us/graph/api/resources/subscription?view=graph-rest-1.0

When I create a delete subscription with resource "groups" and changeType "deleted" it doesn't work at all.
When I create an update subscription with resource "groups" and changeType "updated" it catches both update and delete events.
When I create a combined subscription with resource "groups" and changeType "updated,deleted" it catches both update and delete events but doesn't distinguish between the two.

It looks like a bug in GraphAPI.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,489 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Diana Wanjuhi 1,376 Reputation points
    2021-02-15T14:27:36.87+00:00

    From the documentation here: https://learn.microsoft.com/en-us/graph/delta-query-groups#deltalink-response and https://learn.microsoft.com/en-us/graph/api/resources/directory?view=graph-rest-1.0 we see that when an item is deleted, it is added to the deleted items "container". Deleted items will remain available to restore for up to 30 days. After 30 days, the items are permanently deleted. This would explain the behavior above where when a group is deleted, an updated notification is sent.

    0 comments No comments

  2. Mark Babayev 226 Reputation points
    2021-02-15T16:24:35.567+00:00

    Hello Diana,

    What do you mean by the deleted items "container"?
    The deleted group members indeed are seen somewhere like this:

    "members@delta": [{
       "@removed": {
          "reason": "deleted"
       }
     }]
    

    But the deleted groups simply disappear.
    Moreover, the "deleted" action event never arrives and the "updated" action event arrives in both cases and always shows that the group has been updated.

    If in both cases there is sent an "updated" event, how can I know when it is updated and when deleted?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.