【发布时间】:2020-10-22 05:09:22
【问题描述】:
我正在尝试使用 C# 中的 Graph API 过滤 ToReceipient。
根据Unable to filter messages by recipient in Microsoft Graph Api. One or more invalid nodes
目前过滤器不支持收件人。我需要使用搜索。
但是在 c# 中,根据下面的屏幕截图和代码,它似乎没有搜索属性,只有过滤器。任何人都知道如何在 Graph API c# 中使用搜索?我还需要根据多个收件人电子邮件地址对其进行过滤。谢谢。
IUserMessagesCollectionPage msgs = await client.Users["user@domain.com"].Messages.Request().Filter ==> exist
IUserMessagesCollectionPage msgs = await client.Users["user@domain.com"].Messages.Request().Search ==> does not exist
【问题讨论】:
-
你可以尝试使用QueryOptions类如下
List<QueryOption> options = new List<QueryOption> { new QueryOption("$search", "lunch") }; var messages = await client.Users["user@domain.com"].Messages.Request(options).GetAsync(); -
它对你有用吗?
-
不,它不起作用。你试过代码吗?你有完整的工作代码示例吗?谢谢
-
如果我只搜索 gmail 它可以工作,但如果我输入完整的电子邮件地址,它就不能说“。”不是一个有效的字符。如果你有“。”你会怎么做?在电子邮件地址中?谢谢
-
我在这里提出了另一个问题stackoverflow.com/questions/64528984/…
标签: c# .net-core microsoft-graph-api