Microsoft-Graph在Webhook订阅上使用$ filter [英] Microsoft-Graph use $filter on webhook subscriptions

查看:68
本文介绍了Microsoft-Graph在Webhook订阅上使用$ filter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户从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:

POST https://graph.microsoft.com/v1.0/subscriptions
{
资源":组?$ 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通知尚不支持过滤表达式.您可以订阅整个资源集合的更改(资源":组"),也可以为单个组创建订阅(资源​​":组/").后者只会导致该组的更改.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆