Bạn có thể tìm kiếm các thiết bị khớp với một số thuộc tính nhất định bằng phương thức mobiledevices.list của Directory API. Phương thức này chấp nhận tham số query là một truy vấn tìm kiếm kết hợp một hoặc nhiều mệnh đề tìm kiếm. Mỗi mệnh đề tìm kiếm bao gồm
ba phần:
Trường
Thuộc tính thiết bị được tìm kiếm. Ví dụ: serial.
Đơn vị tổ chức
Kiểm thử được thực hiện trên dữ liệu để cung cấp kết quả so khớp. Ví dụ: toán tử : kiểm tra xem một thuộc tính văn bản có khớp với một giá trị hay không.
Giá trị
Nội dung của thuộc tính được kiểm thử. Ví dụ: serialNumber.
Nhiều mệnh đề được phân tách bằng khoảng trắng và được kết hợp ngầm ẩn bằng toán tử AND.
Ví dụ
Tất cả truy vấn đều sử dụng phương thức mobiledevices.list. Phương thức này có một yêu cầu HTTP tương tự như sau (đã thêm dấu ngắt dòng để dễ đọc):
GET https://admin.googleapis.com/admin/directory/v1/customer/customerId/devices/mobile
?query=query parameters
Các tham số query phải được mã hoá URL. Ví dụ: truy vấn query=brand:goo* được mã hoá URL thành query=brand%3goo*.
Tất cả ví dụ trên trang này đều hiển thị các tham số query chưa được mã hoá.
Thư viện ứng dụng sẽ tự động xử lý việc mã hoá URL này.
[null,null,["Cập nhật lần gần đây nhất: 2025-01-27 UTC."],[[["The `mobiledevices.list` method allows you to search for devices with specific attributes using a `query` parameter."],["A search query is built with clauses consisting of a field, operator, and value, separated by whitespace and implicitly joined by `AND`."],["Queries can use wildcards like `*` for partial matches and multiple clauses can be combined for more refined searches."],["It's important to note that data updates can take up to 36 hours to be reflected in search results."],["Refer to the \"Personal device search fields\" documentation for a complete list of searchable device attributes."]]],["The `mobiledevices.list` method in the Directory API allows searching for devices using the `query` parameter. A query consists of clauses: a Field (attribute), an Operator (test), and a Value (content). Clauses are implicitly joined by `AND`. For example, `serial:525*` searches for serial numbers starting with \"525\". Multiple fields can be used in a single query, such as `email:fred* email:contact*`. Queries are URL encoded, and client libraries manage this automatically. Data updates can take up to 36 hours to reflect in search results.\n"]]