MSGraph Delete Group Push Notifications: Wrong changeType on Delete Events
up vote
0
down vote
favorite
When I perform a deletion of a group in the Azure AD portal and I have set my push notification changeType = 'updated,deleted', the push notification is received within 10-15 seconds as expected with the correct resource ID of the group that I deleted, but the changeType = 'updated'. See the actual event received below:
{
"value":[
{
"changeType":"updated",
"clientState":"<<redacted>>",
"resource":"Groups/f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"resourceData":{
"@odata.type":"#Microsoft.Graph.Group",
"@odata.id":"Groups/f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"id":"f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"organizationId":"<<redacted>>",
"eventTime":"2018-11-22T01:47:00.2455823Z",
"sequenceNumber":636784480202455800
},
"subscriptionExpirationDateTime":"2018-11-24T18:13:08.914+00:00",
"subscriptionId":"d850b120-19bb-4291-b9c4-845ea04dd38d",
"tenantId":"<<readacted>>"
}
]
}
Upon processing this request, there is no way to determine that the current group resource has been DELETED. Can someone on the Graph API team please look into/resolve?
azure-active-directory microsoft-graph azure-ad-graph-api
add a comment |
up vote
0
down vote
favorite
When I perform a deletion of a group in the Azure AD portal and I have set my push notification changeType = 'updated,deleted', the push notification is received within 10-15 seconds as expected with the correct resource ID of the group that I deleted, but the changeType = 'updated'. See the actual event received below:
{
"value":[
{
"changeType":"updated",
"clientState":"<<redacted>>",
"resource":"Groups/f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"resourceData":{
"@odata.type":"#Microsoft.Graph.Group",
"@odata.id":"Groups/f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"id":"f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"organizationId":"<<redacted>>",
"eventTime":"2018-11-22T01:47:00.2455823Z",
"sequenceNumber":636784480202455800
},
"subscriptionExpirationDateTime":"2018-11-24T18:13:08.914+00:00",
"subscriptionId":"d850b120-19bb-4291-b9c4-845ea04dd38d",
"tenantId":"<<readacted>>"
}
]
}
Upon processing this request, there is no way to determine that the current group resource has been DELETED. Can someone on the Graph API team please look into/resolve?
azure-active-directory microsoft-graph azure-ad-graph-api
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
When I perform a deletion of a group in the Azure AD portal and I have set my push notification changeType = 'updated,deleted', the push notification is received within 10-15 seconds as expected with the correct resource ID of the group that I deleted, but the changeType = 'updated'. See the actual event received below:
{
"value":[
{
"changeType":"updated",
"clientState":"<<redacted>>",
"resource":"Groups/f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"resourceData":{
"@odata.type":"#Microsoft.Graph.Group",
"@odata.id":"Groups/f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"id":"f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"organizationId":"<<redacted>>",
"eventTime":"2018-11-22T01:47:00.2455823Z",
"sequenceNumber":636784480202455800
},
"subscriptionExpirationDateTime":"2018-11-24T18:13:08.914+00:00",
"subscriptionId":"d850b120-19bb-4291-b9c4-845ea04dd38d",
"tenantId":"<<readacted>>"
}
]
}
Upon processing this request, there is no way to determine that the current group resource has been DELETED. Can someone on the Graph API team please look into/resolve?
azure-active-directory microsoft-graph azure-ad-graph-api
When I perform a deletion of a group in the Azure AD portal and I have set my push notification changeType = 'updated,deleted', the push notification is received within 10-15 seconds as expected with the correct resource ID of the group that I deleted, but the changeType = 'updated'. See the actual event received below:
{
"value":[
{
"changeType":"updated",
"clientState":"<<redacted>>",
"resource":"Groups/f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"resourceData":{
"@odata.type":"#Microsoft.Graph.Group",
"@odata.id":"Groups/f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"id":"f0a5993b-5c2d-49cc-bb2f-8cb0060fef8e",
"organizationId":"<<redacted>>",
"eventTime":"2018-11-22T01:47:00.2455823Z",
"sequenceNumber":636784480202455800
},
"subscriptionExpirationDateTime":"2018-11-24T18:13:08.914+00:00",
"subscriptionId":"d850b120-19bb-4291-b9c4-845ea04dd38d",
"tenantId":"<<readacted>>"
}
]
}
Upon processing this request, there is no way to determine that the current group resource has been DELETED. Can someone on the Graph API team please look into/resolve?
azure-active-directory microsoft-graph azure-ad-graph-api
azure-active-directory microsoft-graph azure-ad-graph-api
asked Nov 22 at 2:13
tfrancois
787
787
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
It is likely that the group you deleted was an Office 365 group. When Office 365 groups are deleted, they are soft-deleted, which is represented as an updated
event, rather than a deleted
change type. You'll notice the same behavior when users are deleted, if you subscribe to updated,deleted
for users
, which also support soft-deletion.
(A soft-deleted Office 365 group can be restored within 30 days. In contrast, other group types get permanently deleted immediately and cannot be restored.)
If you're using delta query in concert with change notifications (a typical pattern is to use the updated
change event as a trigger to poll for more changes with delta query), the soft-deletion of a group would look like this:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "changed"
}
}
]
}
When a soft-deleted Office 365 group gets permanently deleted (either naturally, after the 30 days pass, or manually, because someone permanently deleted it), you will get the expected deleted
change type in the subscription:
{
"value": [
{
"changeType": "deleted",
"resource": "Groups/0ed62d01-7c00-4866-9220-74fdd034eea7",
"resourceData": ...
...
}
]
}
In the delta query for groups, the group's permanent deletion will be represented as follows:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "deleted"
}
}
]
}
Other info
Office 365 groups can be identified in Microsoft Graph by their groupTypes
attribute, which will contain the string Unified
if it's an Office 365 group.
GET https://graph.microsoft.com/v1.0/groups/{id}?$select=id,displayName,groupTypes
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups(id,groupTypes)/$entity",
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"displayName": "My Office 365 group",
"groupTypes": [
"Unified"
]
}
Soft-deleted groups can be listed with Microsoft Graph:
GET https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.group
To permanently delete a soft-deleted object using Microsoft Graph:
DELETE https://graph.microsoft.com/v1.0/directory/deletedItems/{id}
1
Thank you for this outstanding reply and full explanation. I appreciate the time and effort you put in for this and I now understand this fully. I wish Microsoft's own documentation was as thorough on this topic. Happy holidays sir!
– tfrancois
Nov 22 at 15:49
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
It is likely that the group you deleted was an Office 365 group. When Office 365 groups are deleted, they are soft-deleted, which is represented as an updated
event, rather than a deleted
change type. You'll notice the same behavior when users are deleted, if you subscribe to updated,deleted
for users
, which also support soft-deletion.
(A soft-deleted Office 365 group can be restored within 30 days. In contrast, other group types get permanently deleted immediately and cannot be restored.)
If you're using delta query in concert with change notifications (a typical pattern is to use the updated
change event as a trigger to poll for more changes with delta query), the soft-deletion of a group would look like this:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "changed"
}
}
]
}
When a soft-deleted Office 365 group gets permanently deleted (either naturally, after the 30 days pass, or manually, because someone permanently deleted it), you will get the expected deleted
change type in the subscription:
{
"value": [
{
"changeType": "deleted",
"resource": "Groups/0ed62d01-7c00-4866-9220-74fdd034eea7",
"resourceData": ...
...
}
]
}
In the delta query for groups, the group's permanent deletion will be represented as follows:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "deleted"
}
}
]
}
Other info
Office 365 groups can be identified in Microsoft Graph by their groupTypes
attribute, which will contain the string Unified
if it's an Office 365 group.
GET https://graph.microsoft.com/v1.0/groups/{id}?$select=id,displayName,groupTypes
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups(id,groupTypes)/$entity",
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"displayName": "My Office 365 group",
"groupTypes": [
"Unified"
]
}
Soft-deleted groups can be listed with Microsoft Graph:
GET https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.group
To permanently delete a soft-deleted object using Microsoft Graph:
DELETE https://graph.microsoft.com/v1.0/directory/deletedItems/{id}
1
Thank you for this outstanding reply and full explanation. I appreciate the time and effort you put in for this and I now understand this fully. I wish Microsoft's own documentation was as thorough on this topic. Happy holidays sir!
– tfrancois
Nov 22 at 15:49
add a comment |
up vote
1
down vote
accepted
It is likely that the group you deleted was an Office 365 group. When Office 365 groups are deleted, they are soft-deleted, which is represented as an updated
event, rather than a deleted
change type. You'll notice the same behavior when users are deleted, if you subscribe to updated,deleted
for users
, which also support soft-deletion.
(A soft-deleted Office 365 group can be restored within 30 days. In contrast, other group types get permanently deleted immediately and cannot be restored.)
If you're using delta query in concert with change notifications (a typical pattern is to use the updated
change event as a trigger to poll for more changes with delta query), the soft-deletion of a group would look like this:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "changed"
}
}
]
}
When a soft-deleted Office 365 group gets permanently deleted (either naturally, after the 30 days pass, or manually, because someone permanently deleted it), you will get the expected deleted
change type in the subscription:
{
"value": [
{
"changeType": "deleted",
"resource": "Groups/0ed62d01-7c00-4866-9220-74fdd034eea7",
"resourceData": ...
...
}
]
}
In the delta query for groups, the group's permanent deletion will be represented as follows:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "deleted"
}
}
]
}
Other info
Office 365 groups can be identified in Microsoft Graph by their groupTypes
attribute, which will contain the string Unified
if it's an Office 365 group.
GET https://graph.microsoft.com/v1.0/groups/{id}?$select=id,displayName,groupTypes
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups(id,groupTypes)/$entity",
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"displayName": "My Office 365 group",
"groupTypes": [
"Unified"
]
}
Soft-deleted groups can be listed with Microsoft Graph:
GET https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.group
To permanently delete a soft-deleted object using Microsoft Graph:
DELETE https://graph.microsoft.com/v1.0/directory/deletedItems/{id}
1
Thank you for this outstanding reply and full explanation. I appreciate the time and effort you put in for this and I now understand this fully. I wish Microsoft's own documentation was as thorough on this topic. Happy holidays sir!
– tfrancois
Nov 22 at 15:49
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
It is likely that the group you deleted was an Office 365 group. When Office 365 groups are deleted, they are soft-deleted, which is represented as an updated
event, rather than a deleted
change type. You'll notice the same behavior when users are deleted, if you subscribe to updated,deleted
for users
, which also support soft-deletion.
(A soft-deleted Office 365 group can be restored within 30 days. In contrast, other group types get permanently deleted immediately and cannot be restored.)
If you're using delta query in concert with change notifications (a typical pattern is to use the updated
change event as a trigger to poll for more changes with delta query), the soft-deletion of a group would look like this:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "changed"
}
}
]
}
When a soft-deleted Office 365 group gets permanently deleted (either naturally, after the 30 days pass, or manually, because someone permanently deleted it), you will get the expected deleted
change type in the subscription:
{
"value": [
{
"changeType": "deleted",
"resource": "Groups/0ed62d01-7c00-4866-9220-74fdd034eea7",
"resourceData": ...
...
}
]
}
In the delta query for groups, the group's permanent deletion will be represented as follows:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "deleted"
}
}
]
}
Other info
Office 365 groups can be identified in Microsoft Graph by their groupTypes
attribute, which will contain the string Unified
if it's an Office 365 group.
GET https://graph.microsoft.com/v1.0/groups/{id}?$select=id,displayName,groupTypes
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups(id,groupTypes)/$entity",
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"displayName": "My Office 365 group",
"groupTypes": [
"Unified"
]
}
Soft-deleted groups can be listed with Microsoft Graph:
GET https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.group
To permanently delete a soft-deleted object using Microsoft Graph:
DELETE https://graph.microsoft.com/v1.0/directory/deletedItems/{id}
It is likely that the group you deleted was an Office 365 group. When Office 365 groups are deleted, they are soft-deleted, which is represented as an updated
event, rather than a deleted
change type. You'll notice the same behavior when users are deleted, if you subscribe to updated,deleted
for users
, which also support soft-deletion.
(A soft-deleted Office 365 group can be restored within 30 days. In contrast, other group types get permanently deleted immediately and cannot be restored.)
If you're using delta query in concert with change notifications (a typical pattern is to use the updated
change event as a trigger to poll for more changes with delta query), the soft-deletion of a group would look like this:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "changed"
}
}
]
}
When a soft-deleted Office 365 group gets permanently deleted (either naturally, after the 30 days pass, or manually, because someone permanently deleted it), you will get the expected deleted
change type in the subscription:
{
"value": [
{
"changeType": "deleted",
"resource": "Groups/0ed62d01-7c00-4866-9220-74fdd034eea7",
"resourceData": ...
...
}
]
}
In the delta query for groups, the group's permanent deletion will be represented as follows:
GET https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
"@odata.deltaLink": "https://graph.microsoft.com/v1.0/groups/delta?$deltatoken=1yN...",
"value": [
{
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"@removed": {
"reason": "deleted"
}
}
]
}
Other info
Office 365 groups can be identified in Microsoft Graph by their groupTypes
attribute, which will contain the string Unified
if it's an Office 365 group.
GET https://graph.microsoft.com/v1.0/groups/{id}?$select=id,displayName,groupTypes
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups(id,groupTypes)/$entity",
"id": "0ed62d01-7c00-4866-9220-74fdd034eea7",
"displayName": "My Office 365 group",
"groupTypes": [
"Unified"
]
}
Soft-deleted groups can be listed with Microsoft Graph:
GET https://graph.microsoft.com/v1.0/directory/deletedItems/microsoft.graph.group
To permanently delete a soft-deleted object using Microsoft Graph:
DELETE https://graph.microsoft.com/v1.0/directory/deletedItems/{id}
edited Nov 23 at 16:31
answered Nov 22 at 9:21
Philippe Signoret
6,35412443
6,35412443
1
Thank you for this outstanding reply and full explanation. I appreciate the time and effort you put in for this and I now understand this fully. I wish Microsoft's own documentation was as thorough on this topic. Happy holidays sir!
– tfrancois
Nov 22 at 15:49
add a comment |
1
Thank you for this outstanding reply and full explanation. I appreciate the time and effort you put in for this and I now understand this fully. I wish Microsoft's own documentation was as thorough on this topic. Happy holidays sir!
– tfrancois
Nov 22 at 15:49
1
1
Thank you for this outstanding reply and full explanation. I appreciate the time and effort you put in for this and I now understand this fully. I wish Microsoft's own documentation was as thorough on this topic. Happy holidays sir!
– tfrancois
Nov 22 at 15:49
Thank you for this outstanding reply and full explanation. I appreciate the time and effort you put in for this and I now understand this fully. I wish Microsoft's own documentation was as thorough on this topic. Happy holidays sir!
– tfrancois
Nov 22 at 15:49
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53422974%2fmsgraph-delete-group-push-notifications-wrong-changetype-on-delete-events%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown