问题
I'm interested to use webhook to notify me when a user was added/removed from a Team on Microsoft Teams.
But do not create a subscription for each team I prefer to enter in the filter the team that I am interested in being notified.
So I used this Request:
POST https://graph.microsoft.com/v1.0/subscriptions
{
"resource": "groups?$filter=mail eq 'someGroupmail@domain.com' or 'ohterGroupMail@domain.com'",
"changeType": "updated",
"clientState": "1234",
"notificationUrl": "https://1234.ngrok.io/xxxxx",
"expirationDateTime": "2019-01-05T12:21:25Z"
}
The subscription was successful created (receive response 200-OK), but I noticed that I received notifications even on the groups not being in the filter, I have the impression that the filter is not taken into account.
There is no way to create a subscription on multiple groups in one request?
回答1:
Filtering expressions are not yet supported by Microsoft Graph notifications. You can subscribe to changes on the entire resource collection ("resource": "groups") or you can create a subscription for a single group ("resource": "groups/"). The latter will result in changes for that group only.
来源:https://stackoverflow.com/questions/54017888/microsoft-graph-use-filter-on-webhook-subscriptions