【问题标题】:Filter (searching) on Microsoft Azure (graph) API在 Microsoft Azure(图形)API 上过滤(搜索)
【发布时间】:2017-01-25 04:42:11
【问题描述】:

我想通过传递手机号码或邮政编码来查询 Microsoft Azure AD。我可以使用startsWith() 函数使用givenName 进行过滤,但无法使用手机/邮政编码进行搜索。

我的请求是users?$filter=postalCode%20eq%20'560036'&api-version=1.6

并得到响应:

{
  "odata.error": {
    "code": "Request_UnsupportedQuery",
    "message": {
      "lang": "en",
      "value": "Unsupported or invalid query filter clause specified for property 'postalCode' of resource 'User'."
    }
  }
}

【问题讨论】:

  • 在 Graph Explorer 中也试过了,似乎不支持:\

标签: azure filter azure-ad-graph-api


【解决方案1】:

根据微软开发人员中的这个旧post,如果您使用startsWith() 函数,您可以添加OR 子句来过滤多个字段。

users?$filter=startswith(postalCode, '560036') OR startswith(mobileNumber, '123456')

当然,你还是要对等号、括号和空格进行编码

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-23
    • 1970-01-01
    • 2018-07-23
    • 1970-01-01
    • 2015-01-08
    • 2021-02-23
    • 1970-01-01
    相关资源
    最近更新 更多