Webhook (aka Subscription) for groups ressource changeType = created not working

%3CLINGO-SUB%20id%3D%22lingo-sub-106356%22%20slang%3D%22en-US%22%3EWebhook%20(aka%20Subscription)%20for%20groups%20ressource%20changeType%20%3D%20created%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-106356%22%20slang%3D%22en-US%22%3E%3CP%3EHI%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20looking%20for%20an%20fast%20and%20efficiant%20way%20to%20get%20notified%20for%20new%20AAD%20groups%20(unified%20groups%20to%20be%20exact).%20I%20could%20us%20the%20groups%20endpoint%20and%20then%20do%20a%20delta%20query%20every%205%20minutes.%20But%20this%20is%20not%20%22instant%22.%26nbsp%3BMS%20Graph%20offers%20their%20implementation%20of%20webhooks%20(subscriptions)%20to%20solve%20this%20problem.%20I've%20checked%20the%20github%20repo%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Faspnet-webhooks-rest-sample%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Faspnet-webhooks-rest-sample%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20it%20works%20as%20designed%20for%20user%20email%20messages.%20I've%20modifed%20the%20code%20to%20get%20a%20subscription%20for%20groups.%20Currents%20these%20are%20only%20available%20in%20the%20%2Fbeta%20version.%20So%20I%20changed%20all%20URL%20and%20the%20message%20example%20is%20working%20on%20the%20beta%20version.%20Then%20I%20changed%20the%20subscription%26nbsp%3Bfrom%20messages%20to%20groups.%20But%20the%20sample%20refused%20to%20work.%20I%20tried%20the%20same%20request%20using%20the%20MS%20Graph%20Explorer%20but%20also%20failed%20due%20to%20this%20message%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%7B%0A%20%20%20%20%22error%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22code%22%3A%20%22InvalidRequest%22%2C%0A%20%20%20%20%20%20%20%20%22message%22%3A%20%22Invalid%20'changeType'%20attribute%3A%20'created'.%22%2C%0A%20%20%20%20%20%20%20%20%22innerError%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22request-id%22%3A%20%229b786de2-1780-4ccf-9d1a-1243d0435ce1%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22date%22%3A%20%222017-09-14T13%3A37%3A33%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%3C%2FPRE%3E%3CP%3EThe%20message%20is%20indicating%20that%20%22created%22%20is%20not%20supported%20%3A(%3C%2Fimg%3E%20The%20same%20request%20with%20%22updated%22%20is%20working%20as%20expected%20%3A(%3C%2Fimg%3E%20Permissions%20for%20the%20app%20are%20updated%20with%20Group.Read.All%20as%20the%20docs%20states.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20the%20request%3A%3C%2FP%3E%3CPRE%3E%7B%0A%20%20%22changeType%22%3A%20%22created%22%2C%0A%20%20%22clientState%22%3A%20%22ca07f995-5f94-4a7a-903a-a6f9deb517e4%22%2C%0A%20%20%22notificationUrl%22%3A%20%22https%3A%2F%2Fgkm-msgraph-webhook.azurewebsites.net%2Fnotification%2Flisten%22%2C%0A%20%20%22resource%22%3A%20%22groups%22%2C%0A%20%20%22expirationDateTime%22%3A%20%222017-09-14T13%3A09%3A26.8315691%2B00%3A00%22%0A%7D%3C%2FPRE%3E%3CP%3E%26nbsp%3BThe%20docs%20are%20suggesting%20it%20should%20work%20(I%20know%20it%20is%20the%20beta%20hive).%20Any%20idea%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThese%20are%20the%20docs%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fapi%2Fsubscription_post_subscriptions%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fgraph%2Fdocs%2Fapi-reference%2Fbeta%2Fapi%2Fsubscription_post_subscriptions%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-106356%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-334834%22%20slang%3D%22en-US%22%3ERe%3A%20Webhook%20(aka%20Subscription)%20for%20groups%20ressource%20changeType%20%3D%20created%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-334834%22%20slang%3D%22en-US%22%3ESorry%20very%20late%20response.%3CBR%20%2F%3E%3CBR%20%2F%3ENo%2C%20I%20just%20filter%20out%20those%20signals.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204078%22%20slang%3D%22en-US%22%3ERe%3A%20Webhook%20(aka%20Subscription)%20for%20groups%20ressource%20changeType%20%3D%20created%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204078%22%20slang%3D%22en-US%22%3E%3CP%3EWere%20you%20able%20to%20configure%20a%26nbsp%3Bsubscription%20to%20only%20Unified%20Groups%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-159182%22%20slang%3D%22en-US%22%3ERe%3A%20Webhook%20(aka%20Subscription)%20for%20groups%20ressource%20changeType%20%3D%20created%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-159182%22%20slang%3D%22en-US%22%3Equick%20note%20-%20updated%20and%20deleted%20works.%3CBR%20%2F%3E%3CBR%20%2F%3EI've%20got%20feedback%20that%20MSGraph%20currently%20shows%20'created'%20event%20as%20part%20of%20'updated'%20event.%20%20So%20listening%20to%20'updated'%20event%20will%20trigger%20on%20new%20groups.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-139894%22%20slang%3D%22en-US%22%3ERe%3A%20Webhook%20(aka%20Subscription)%20for%20groups%20ressource%20changeType%20%3D%20created%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-139894%22%20slang%3D%22en-US%22%3E%3CP%3EI%20wanted%20to%20add%20that%20I%20can%20still%20reproduce%20this%20problem.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22error%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22code%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22InvalidRequest%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22message%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22Invalid%26nbsp%3B'changeType'%26nbsp%3Battribute%3A%26nbsp%3B'created'.%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22innerError%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%7B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22request-id%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%22a311f723-b5e8-4434-9e34-1f19fa492439%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%2C%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk20%22%3E%22date%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%3A%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22mtk5%22%3E%222017-12-26T12%3A10%3A02%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%3CSPAN%20class%3D%22mtk1%22%3E%7D%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EChange%20Type%20values%20for%20%22updated%22%20or%20%22deleted%22%20works.%26nbsp%3B%20My%20listener%20gets%20called%20with%20validation%20token%20and%20I%20return%20that%20(if%20I%20don't%20subscription%20errors).%26nbsp%3B%20But%20then%20I%20get%20an%20internalServerError%20after%20that%20so%20still%20stuck.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

HI,

 

I'm looking for an fast and efficiant way to get notified for new AAD groups (unified groups to be exact). I could us the groups endpoint and then do a delta query every 5 minutes. But this is not "instant". MS Graph offers their implementation of webhooks (subscriptions) to solve this problem. I've checked the github repo:

https://github.com/microsoftgraph/aspnet-webhooks-rest-sample

 

And it works as designed for user email messages. I've modifed the code to get a subscription for groups. Currents these are only available in the /beta version. So I changed all URL and the message example is working on the beta version. Then I changed the subscription from messages to groups. But the sample refused to work. I tried the same request using the MS Graph Explorer but also failed due to this message:

 

{
    "error": {
        "code": "InvalidRequest",
        "message": "Invalid 'changeType' attribute: 'created'.",
        "innerError": {
            "request-id": "9b786de2-1780-4ccf-9d1a-1243d0435ce1",
            "date": "2017-09-14T13:37:33"
        }
    }
}

The message is indicating that "created" is not supported :( The same request with "updated" is working as expected :( Permissions for the app are updated with Group.Read.All as the docs states.

 

This is the request:

{
  "changeType": "created",
  "clientState": "ca07f995-5f94-4a7a-903a-a6f9deb517e4",
  "notificationUrl": "https://gkm-msgraph-webhook.azurewebsites.net/notification/listen",
  "resource": "groups",
  "expirationDateTime": "2017-09-14T13:09:26.8315691+00:00"
}

 The docs are suggesting it should work (I know it is the beta hive). Any idea?

 

These are the docs:

https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/subscription_post_subscripti...

4 Replies
Highlighted

I wanted to add that I can still reproduce this problem.

 

{
  "error": {
    "code""InvalidRequest",
    "message""Invalid 'changeType' attribute: 'created'.",
    "innerError": {
      "request-id""a311f723-b5e8-4434-9e34-1f19fa492439",
      "date""2017-12-26T12:10:02"
    }
  }
}

 

Change Type values for "updated" or "deleted" works.  My listener gets called with validation token and I return that (if I don't subscription errors).  But then I get an internalServerError after that so still stuck.

Highlighted
quick note - updated and deleted works.

I've got feedback that MSGraph currently shows 'created' event as part of 'updated' event. So listening to 'updated' event will trigger on new groups.
Highlighted

Were you able to configure a subscription to only Unified Groups?

Highlighted
Sorry very late response.

No, I just filter out those signals.