אפשר לחפש מכשירים שתואמים למאפיינים מסוימים באמצעות השיטה mobiledevices.list של Directory API. השיטה הזו מקבלת את הפרמטר query, שהוא שאילתה לחיפוש שמשלבת תנאי חיפוש אחד או יותר. כל תנאי חיפוש מורכב משלושה חלקים:
שדה
מאפיין המכשיר שרוצים לחפש. לדוגמה, serial.
מפעיל
בדיקה שמתבצעת על הנתונים כדי לספק התאמה. לדוגמה, האופרטור : בודק אם מאפיין טקסט תואם לערך.
ערך
התוכן של המאפיין שנבדק. לדוגמה, serialNumber.
תנאים מרובים מופרדים באמצעות רווחים ומקושרים באופן משתמע באמצעות אופרטור AND.
דוגמאות
כל השאילתות משתמשות ב-method mobiledevices.list, שכולל בקשת HTTP שדומה לזו שבהמשך (הפסקות שורה נוספו לצורך קריאה קלה יותר):
GET https://admin.googleapis.com/admin/directory/v1/customer/customerId/devices/mobile
?query=query parameters
הפרמטרים query חייבים להיות מקודדים בכתובת ה-URL. לדוגמה, השאילתה query=brand:goo* קודדה ככתובת URL כ-query=brand%3goo*.
בכל הדוגמאות בדף הזה מוצגים פרמטרים query ללא קידוד.
ספריות הלקוח מטפלות בקידוד כתובת ה-URL הזה באופן אוטומטי.
[null,null,["עדכון אחרון: 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"]]