如何在Microsoft Graph Mail API上对$ filter使用'in'运算符?

问题描述

我正在尝试使用Microsoft图形邮件API使用in运算符查询少量电子邮件,但是找不到示例。

这是我尝试使用的方式: '[email protected],[email protected]'中的https://graph.microsoft.com/v1.0/me/messages?$filter=(from/emailAddress/address)

在他们的documentation中,您可以为$ filter使用in运算符。

解决方法

我不反对其他答案,如果有人在寻找 IN 运算符使用格式,我只是留下这个片段:

$filter=displayName in ('group-1','group-2')

编码后的完整网址示例:

https://graph.microsoft.com/v1.0/groups?$filter=displayName%20in%20%28%27group-1%27%2C%20%27group-2%27%29
,

我使用“ eq”代替“ in”,它对我有用。您可以尝试一下。

https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address eq '[email protected]'