只检索会议怎么办?

huangapple go评论56阅读模式
英文:

How to retrieve only meetings?

问题

I want to select only meetings (appointments with multiple people) in MS Graph (not necessarily online meetings). My guess is I would have to filter on the attendees collection not being empty.

  • Is that assumption correct?
  • How do I do that?

I have tried all kinds of variations on attendees like

https://graph.microsoft.com/v1.0/users/{{UserID}}/calendar/events?$filter=start/dateTime ge '{{start_datetime}}' and end/dateTime le '{{end_datetime}}' and attendees.length ne 0

... but so far no success. (The {{...}} are Postman environment variables). All I get is

"error": {
    "code": "BadRequest",
    "message": "Invalid filter clause",

I have looked at lambda operators, but something like this also is an invalid filter:

https://graph.microsoft.com/v1.0/me/calendar/events?$filter=attendees/any(e:e/emailAddress eq '')

Googling for "ms graph empty collection" gives me plenty of posts for people receiving no results, but that's not what I'm looking for. It also does not help that the terms "appointment" and "meeting" are used interchangeably.

Follow-up question: https://stackoverflow.com/questions/75554213/are-lambda-filters-on-subproperties-of-calendar-event-collections-allowed

Update 24 Feb.:
As pointed out in this answer to that follow-up question I cannot use attendees. The answer to my initial question Is that assumption correct? is No. Is there anything else I can filter on to retrieve only meetings?

英文:

I want to select only meetings (appointments with multiple people) in MS Graph (not necessarily online meetings). My guess is I would have to filter on the attendees collection not being empty.

  • Is that assumption correct?
  • How do I do that?

I have tried all kinds of variations on attendees like

https://graph.microsoft.com/v1.0/users/{{UserID}}/calendar/events?$filter=start/dateTime ge '{{start_datetime}}' and end/dateTime le '{{end_datetime}}' and attendees.length ne 0

... but so far no success. (The {{...}} are Postman environment variables). All I get is

"error": {
    "code": "BadRequest",
    "message": "Invalid filter clause",

I have looked at lambda operators, but something like this also is an invalid filter <sup>**</sup>:

https://graph.microsoft.com/v1.0/me/calendar/events?$filter=attendees/any(e:e/emailAddress eq &#39;&#39;)

Googling for "ms graph empty collection" gives me plenty of posts for people receiving no results, but that's not what I'm looking for. It also does not help that the terms "appointment" and "meeting" are used interchangeably 只检索会议怎么办?

<sup>** Follow-up question: https://stackoverflow.com/questions/75554213/are-lambda-filters-on-subproperties-of-calendar-event-collections-allowed&lt;/sup>

Update 24 Feb.:<br />
As pointed out in this answer to that follow-up question I cannot uses attendees. The answer to my initial question Is that assumption correct? is No. Is there anything else I can filter on to retrieve only meetings?

答案1

得分: 1

25-02-2023发布此内容时,不支持在Microsoft Graph API中将$filter运算符与eventattendees属性上的$count运算符组合使用。

尽管在在线图形资源浏览器中运行此查询https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/$count ne 0&amp;$count=true可以正常工作,但对于类似事件的操作却不起作用,例如https://graph.microsoft.com/v1.0/me/events?$filter=assignedLicenses/$count ne 0&amp;$count=true,并导致以下结果:

{
    "error": {
        "code": "ErrorInvalidUrlQueryFilter",
        "message": "The query filter contains one or more invalid nodes."
    }
}

Microsoft文档指出,如果您希望在不支持的属性上使用$filter,您可以在此处提交请求以获取支持。

英文:

When posting this on 25-02-2023 it is not supported to combine the $filter operator with the $count operator on the attendees property of an event in microsoft graph api.

Seeing as running this query https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/$count ne 0&amp;$count=true in the online graph exlorer works fine, but doing the same for events like this https://graph.microsoft.com/v1.0/me/events?$filter=assignedLicenses/$count ne 0&amp;$count=true doesn't work. and results in this

{
    &quot;error&quot;: {
        &quot;code&quot;: &quot;ErrorInvalidUrlQueryFilter&quot;,
        &quot;message&quot;: &quot;The query filter contains one or more invalid nodes.&quot;
    }
}

The microsoft documentation states that if you want support for using the $filter on a not supported property you can request it here

huangapple
  • 本文由 发表于 2023年2月23日 22:20:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/75546082.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定