MSGraph Delete Group Push Notifications: Wrong changeType on Delete Events












0















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?










share|improve this question



























    0















    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?










    share|improve this question

























      0












      0








      0


      1






      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?










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 '18 at 2:13









      tfrancoistfrancois

      788




      788
























          1 Answer
          1






          active

          oldest

          votes


















          2














          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}





          share|improve this answer





















          • 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 '18 at 15:49













          • philippe-signoret: Quick question for you sir. I've used the methodology you've outlined and it works well but here is something I'm hoping you can help implement at Microsoft ASAP. When you want to initiate a delta on a group, can we have the option to make the starting point as NOW rather than having to cycle through all the changes before being able to obtain the most up-to-date deltaToken at the very end to be "caught up". Why would this be helpful? Let's say you create a group and sync the changes at same time, there's no need to have to cycle thru all records...

            – tfrancois
            Dec 14 '18 at 5:31











          • ...all that is needed at this point is the deltaToken to track changes from @now forward. This would save tons and tons of processing I'm sure on MS servers, especially on large groups with hundreds or thousands of members. It would make the deltaQuery more usuable too. Less logic would have to be written if all you care about is future changes rather than all changes since group creation. Please help and advise on how possible this could be implemented. Again, I think it would cut down on the likelihood of high loads from those using this feature. Thanks in advance!

            – tfrancois
            Dec 14 '18 at 5:35






          • 1





            @tfrancois You can already do this! In you initial delta request, add the query parameter $deltaToken=latest: GET .../groups/delta?$filter=...&$deltaToken=latest, and the response will only contain a $deltaLink as of "now". See the note in the docs: docs.microsoft.com/en-us/graph/…

            – Philippe Signoret
            Dec 14 '18 at 14:31






          • 1





            SIr that is OUTSTANDING! This must have been added recently because I swore I went through all the documentation on delta query prior to my reply. Nevertheless this is EXACTLY what I was looking for! Very excting. Thank you!

            – tfrancois
            Dec 14 '18 at 14:51














          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          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

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          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}





          share|improve this answer





















          • 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 '18 at 15:49













          • philippe-signoret: Quick question for you sir. I've used the methodology you've outlined and it works well but here is something I'm hoping you can help implement at Microsoft ASAP. When you want to initiate a delta on a group, can we have the option to make the starting point as NOW rather than having to cycle through all the changes before being able to obtain the most up-to-date deltaToken at the very end to be "caught up". Why would this be helpful? Let's say you create a group and sync the changes at same time, there's no need to have to cycle thru all records...

            – tfrancois
            Dec 14 '18 at 5:31











          • ...all that is needed at this point is the deltaToken to track changes from @now forward. This would save tons and tons of processing I'm sure on MS servers, especially on large groups with hundreds or thousands of members. It would make the deltaQuery more usuable too. Less logic would have to be written if all you care about is future changes rather than all changes since group creation. Please help and advise on how possible this could be implemented. Again, I think it would cut down on the likelihood of high loads from those using this feature. Thanks in advance!

            – tfrancois
            Dec 14 '18 at 5:35






          • 1





            @tfrancois You can already do this! In you initial delta request, add the query parameter $deltaToken=latest: GET .../groups/delta?$filter=...&$deltaToken=latest, and the response will only contain a $deltaLink as of "now". See the note in the docs: docs.microsoft.com/en-us/graph/…

            – Philippe Signoret
            Dec 14 '18 at 14:31






          • 1





            SIr that is OUTSTANDING! This must have been added recently because I swore I went through all the documentation on delta query prior to my reply. Nevertheless this is EXACTLY what I was looking for! Very excting. Thank you!

            – tfrancois
            Dec 14 '18 at 14:51


















          2














          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}





          share|improve this answer





















          • 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 '18 at 15:49













          • philippe-signoret: Quick question for you sir. I've used the methodology you've outlined and it works well but here is something I'm hoping you can help implement at Microsoft ASAP. When you want to initiate a delta on a group, can we have the option to make the starting point as NOW rather than having to cycle through all the changes before being able to obtain the most up-to-date deltaToken at the very end to be "caught up". Why would this be helpful? Let's say you create a group and sync the changes at same time, there's no need to have to cycle thru all records...

            – tfrancois
            Dec 14 '18 at 5:31











          • ...all that is needed at this point is the deltaToken to track changes from @now forward. This would save tons and tons of processing I'm sure on MS servers, especially on large groups with hundreds or thousands of members. It would make the deltaQuery more usuable too. Less logic would have to be written if all you care about is future changes rather than all changes since group creation. Please help and advise on how possible this could be implemented. Again, I think it would cut down on the likelihood of high loads from those using this feature. Thanks in advance!

            – tfrancois
            Dec 14 '18 at 5:35






          • 1





            @tfrancois You can already do this! In you initial delta request, add the query parameter $deltaToken=latest: GET .../groups/delta?$filter=...&$deltaToken=latest, and the response will only contain a $deltaLink as of "now". See the note in the docs: docs.microsoft.com/en-us/graph/…

            – Philippe Signoret
            Dec 14 '18 at 14:31






          • 1





            SIr that is OUTSTANDING! This must have been added recently because I swore I went through all the documentation on delta query prior to my reply. Nevertheless this is EXACTLY what I was looking for! Very excting. Thank you!

            – tfrancois
            Dec 14 '18 at 14:51
















          2












          2








          2







          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}





          share|improve this answer















          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}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 23 '18 at 16:31

























          answered Nov 22 '18 at 9:21









          Philippe SignoretPhilippe Signoret

          6,96712443




          6,96712443








          • 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 '18 at 15:49













          • philippe-signoret: Quick question for you sir. I've used the methodology you've outlined and it works well but here is something I'm hoping you can help implement at Microsoft ASAP. When you want to initiate a delta on a group, can we have the option to make the starting point as NOW rather than having to cycle through all the changes before being able to obtain the most up-to-date deltaToken at the very end to be "caught up". Why would this be helpful? Let's say you create a group and sync the changes at same time, there's no need to have to cycle thru all records...

            – tfrancois
            Dec 14 '18 at 5:31











          • ...all that is needed at this point is the deltaToken to track changes from @now forward. This would save tons and tons of processing I'm sure on MS servers, especially on large groups with hundreds or thousands of members. It would make the deltaQuery more usuable too. Less logic would have to be written if all you care about is future changes rather than all changes since group creation. Please help and advise on how possible this could be implemented. Again, I think it would cut down on the likelihood of high loads from those using this feature. Thanks in advance!

            – tfrancois
            Dec 14 '18 at 5:35






          • 1





            @tfrancois You can already do this! In you initial delta request, add the query parameter $deltaToken=latest: GET .../groups/delta?$filter=...&$deltaToken=latest, and the response will only contain a $deltaLink as of "now". See the note in the docs: docs.microsoft.com/en-us/graph/…

            – Philippe Signoret
            Dec 14 '18 at 14:31






          • 1





            SIr that is OUTSTANDING! This must have been added recently because I swore I went through all the documentation on delta query prior to my reply. Nevertheless this is EXACTLY what I was looking for! Very excting. Thank you!

            – tfrancois
            Dec 14 '18 at 14:51
















          • 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 '18 at 15:49













          • philippe-signoret: Quick question for you sir. I've used the methodology you've outlined and it works well but here is something I'm hoping you can help implement at Microsoft ASAP. When you want to initiate a delta on a group, can we have the option to make the starting point as NOW rather than having to cycle through all the changes before being able to obtain the most up-to-date deltaToken at the very end to be "caught up". Why would this be helpful? Let's say you create a group and sync the changes at same time, there's no need to have to cycle thru all records...

            – tfrancois
            Dec 14 '18 at 5:31











          • ...all that is needed at this point is the deltaToken to track changes from @now forward. This would save tons and tons of processing I'm sure on MS servers, especially on large groups with hundreds or thousands of members. It would make the deltaQuery more usuable too. Less logic would have to be written if all you care about is future changes rather than all changes since group creation. Please help and advise on how possible this could be implemented. Again, I think it would cut down on the likelihood of high loads from those using this feature. Thanks in advance!

            – tfrancois
            Dec 14 '18 at 5:35






          • 1





            @tfrancois You can already do this! In you initial delta request, add the query parameter $deltaToken=latest: GET .../groups/delta?$filter=...&$deltaToken=latest, and the response will only contain a $deltaLink as of "now". See the note in the docs: docs.microsoft.com/en-us/graph/…

            – Philippe Signoret
            Dec 14 '18 at 14:31






          • 1





            SIr that is OUTSTANDING! This must have been added recently because I swore I went through all the documentation on delta query prior to my reply. Nevertheless this is EXACTLY what I was looking for! Very excting. Thank you!

            – tfrancois
            Dec 14 '18 at 14:51










          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 '18 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 '18 at 15:49















          philippe-signoret: Quick question for you sir. I've used the methodology you've outlined and it works well but here is something I'm hoping you can help implement at Microsoft ASAP. When you want to initiate a delta on a group, can we have the option to make the starting point as NOW rather than having to cycle through all the changes before being able to obtain the most up-to-date deltaToken at the very end to be "caught up". Why would this be helpful? Let's say you create a group and sync the changes at same time, there's no need to have to cycle thru all records...

          – tfrancois
          Dec 14 '18 at 5:31





          philippe-signoret: Quick question for you sir. I've used the methodology you've outlined and it works well but here is something I'm hoping you can help implement at Microsoft ASAP. When you want to initiate a delta on a group, can we have the option to make the starting point as NOW rather than having to cycle through all the changes before being able to obtain the most up-to-date deltaToken at the very end to be "caught up". Why would this be helpful? Let's say you create a group and sync the changes at same time, there's no need to have to cycle thru all records...

          – tfrancois
          Dec 14 '18 at 5:31













          ...all that is needed at this point is the deltaToken to track changes from @now forward. This would save tons and tons of processing I'm sure on MS servers, especially on large groups with hundreds or thousands of members. It would make the deltaQuery more usuable too. Less logic would have to be written if all you care about is future changes rather than all changes since group creation. Please help and advise on how possible this could be implemented. Again, I think it would cut down on the likelihood of high loads from those using this feature. Thanks in advance!

          – tfrancois
          Dec 14 '18 at 5:35





          ...all that is needed at this point is the deltaToken to track changes from @now forward. This would save tons and tons of processing I'm sure on MS servers, especially on large groups with hundreds or thousands of members. It would make the deltaQuery more usuable too. Less logic would have to be written if all you care about is future changes rather than all changes since group creation. Please help and advise on how possible this could be implemented. Again, I think it would cut down on the likelihood of high loads from those using this feature. Thanks in advance!

          – tfrancois
          Dec 14 '18 at 5:35




          1




          1





          @tfrancois You can already do this! In you initial delta request, add the query parameter $deltaToken=latest: GET .../groups/delta?$filter=...&$deltaToken=latest, and the response will only contain a $deltaLink as of "now". See the note in the docs: docs.microsoft.com/en-us/graph/…

          – Philippe Signoret
          Dec 14 '18 at 14:31





          @tfrancois You can already do this! In you initial delta request, add the query parameter $deltaToken=latest: GET .../groups/delta?$filter=...&$deltaToken=latest, and the response will only contain a $deltaLink as of "now". See the note in the docs: docs.microsoft.com/en-us/graph/…

          – Philippe Signoret
          Dec 14 '18 at 14:31




          1




          1





          SIr that is OUTSTANDING! This must have been added recently because I swore I went through all the documentation on delta query prior to my reply. Nevertheless this is EXACTLY what I was looking for! Very excting. Thank you!

          – tfrancois
          Dec 14 '18 at 14:51







          SIr that is OUTSTANDING! This must have been added recently because I swore I went through all the documentation on delta query prior to my reply. Nevertheless this is EXACTLY what I was looking for! Very excting. Thank you!

          – tfrancois
          Dec 14 '18 at 14:51






















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Can I use Tabulator js library in my java Spring + Thymeleaf project?