基于 Microsoft graph 中的 ccRecipients、bccRecipients、toRecipients 进行筛选 api

Filtering based on ccRecipients, bccRecipients, toRecipients in Microsoft graph api

我想在 ccRecipientsbccRecipientstoRecipients 包含给定电子邮件 ID 时过滤电子邮件.

这是我的要求:

https://graph.microsoft.com/v1.0/users/{{UserId}}/messages?$filter=receivedDateTime ge 2021-09-01 and receivedDateTime lt 2021-12-15 and toRecipients/emailAddress/any(s:s eq 'something@email.com')

对此请求的响应:

{
    "error": {
        "code": "BadRequest",
        "message": "Invalid filter clause",
        "innerError": {
            "date": "2021-10-28T17:57:06",
            "request-id": "some-client-id",
            "client-request-id": "something-client-request-id"
        }
    }
}

如果 ccRecipientsbccRecipientstoRecipients 有没有办法过滤电子邮件包含给定的电子邮件 ID。

您不能根据这些属性进行过滤,因为它们不支持过滤,您可以在搜索中使用它们https://docs.microsoft.com/en-us/graph/search-query-parameter

所以

/me/messages?$search="to:blah@blah.com"&$select=subject,toRecipients

或者您可以使用包含 from、to、cc 的参与者

/me/messages?$search="participants:blah@blah.com"