我正在尝试在/ users查询上使用包含过滤器,例如:https://graph.microsoft.com/v1.0/users?$ filter = contains(displayName,'Garth')
但是,这会导致BadRequest响应,说"An unknown function with name 'contains' was found. This may also be a key lookup on a navigation property, which is not allowed."
根据OData 4.0规范,尽管可以使用包含过滤器 . 有没有办法在用户列表中使用包含过滤器?
2 回答
contains功能不适用于用户 . startsWith可用,例如https://graph.microsoft.com/v1.0/users?$ filter = startswith(displayName,'Garth') .
此外,您可以尝试使用人员API(这仅适用于/ beta) . 这支持$ search AND将进行模糊和语音匹配 . https://graph.microsoft.com/beta/me/people?$ search = Garth