Microsoft-Graph 在 webhook 订阅上使用 $filter [英] Microsoft-Graph use $filter on webhook subscriptions
问题描述
我有兴趣在 Microsoft Teams 的团队中添加/删除用户时使用 webhook 通知我.
但不要为我希望在过滤器中输入我有兴趣收到通知的每个团队创建订阅.
所以我使用了这个请求:
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:
发布 https://graph.microsoft.com/v1.0/subscriptions
{
"resource": "groups?$filter=mail eq 'someGroupmail@domain.com' 或 'ohterGroupMail@domain.com'",
"changeType": "更新",
"clientState": "1234",
"notificationUrl": "https://1234.ngrok.io/xxxxx",
"expirationDateTime": "2019-01-05T12:21:25Z"
}
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"
}
订阅已成功创建(收到响应 200-OK),但我注意到即使没有在过滤器中的组也收到通知,我觉得过滤器没有被考虑在内.
无法在一个请求中为多个组创建订阅?
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?
推荐答案
Microsoft Graph 通知尚不支持筛选表达式.您可以订阅整个资源集合的更改(resource":groups"),也可以为单个组创建订阅(resource":groups/").后者只会导致该组的更改.
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.
这篇关于Microsoft-Graph 在 webhook 订阅上使用 $filter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!