如何按电子邮件地址列表过滤移动设备

How to filter mobile devices by list of e-mail address

我正在使用 Google Admin SDK 目录 API,更具体地说是移动设备。我已经使用了 Google here 提供的工具,并且还使用 .Net 客户端库创建了一个程序来成功获取所有设备。

问题是,我现在需要通过电子邮件列表过滤所有移动设备。我能够使用单个电子邮件地址进行过滤,例如:

https://www.googleapis.com/admin/directory/v1/customer/ZXXXXX/devices
/mobile?projection=BASIC&query=email:EMAIL_HERE&key={YOUR_API_KEY}

但我找不到使用多个电子邮件值进行过滤的方法,例如:

query email: email1:@my-domain.com, email2@my-domain.com, email3@my-domain.com

here 提供的关于搜索字符串格式的文档没有指定也没有给出这种情况的示例。

编辑:关于搜索字符串格式的文档确实是这样说的:

To Search within a specific field: enter an operator followed by an argument. For example, user:joesabia. You can use single words or quoted lists of words as an argument when running an operator query.

所以,我尝试在查询框中做这样的事情:

email:"email1@my-domain,com""email2@my-domain,com"

查询格式中没有OR。您需要使用多个 API 呼叫,每次呼叫一个电子邮件查询,或者只列出所有设备并在本地按电子邮件过滤。

您可以在以 space 分隔的查询字符串中组合多个字段搜索,例如 email=test@example.com name:Test。但在你的情况下,只需尝试这样做 email:test@example.com email:test2@example.com.