我需要检索在不同位置拥有电子邮件的所有用户。电子邮件可能位于
{
...
mail: "[email protected]",
...
}
或
{
...
otherMails: ["[email protected]"],
...
}
我尝试了类似的网址
https://graph.windows.net/mytenant.onmicrosoft.com/users?api-version=1.6&$filter=mail eq '[email protected]' or any(otherMails: mail eq '[email protected]')
但它给出错误:
"value": "')' or ',' expected at position 48 in 'mail eq '[email protected]' or any(otherMails: mail eq '[email protected]')'."
就我而言,我在 Graph Explorer 中运行了 MS Graph 查询,并得到了相同的错误,如下所示:
GET https://graph.microsoft.com/v1.0/users?&$filter=mail eq '[email protected]' or any(otherMails: mail eq '[email protected]')
回复:
为了解决该错误,我运行了以下modified查询并成功获得结果,如下所示:
GET https://graph.microsoft.com/v1.0/users?$filter=mail eq '[email protected]' or otherMails/any(mail: mail eq '[email protected]')
回复:
在您的情况下,当您在查询中使用不正确的语法时,发生了错误。要解决此问题,请使用以下modified查询:
GET https://graph.windows.net/mytenant.onmicrosoft.com/users?api-version=1.6&$filter=mail eq '[email protected]' or otherMails/any(mail: mail eq '[email protected]')