如要瞭解 API 功能,請參閱 Chrome Management Reports API。
下方顯示的所有要求都會使用下列變數:
$TOKEN- OAuth 2 權杖$CUSTOMER- 客戶 ID 或字面值my_customer$ORG_UNIT_ID- 要產生要求的特定組織單位 ID。
計算指定日期範圍內使用的 Chrome 版本
如要查看在特定時間範圍內使用的 Chrome 版本,請使用 filter 參數中的 last_active_date 值。您可以使用 pageSize 和 pageToken 參數控制結果的分頁。
要求
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/reports:countChromeVersions?filter=last_active_date<2020-11-06+AND+last_active_date>2020-11-04"
回應
{
"browserVersions": [
{
"count": "1",
"version": "85.0.4183.83",
"system": "SYSTEM_MAC",
"channel": "STABLE"
},
{
"count": "1",
"version": "85.0.4183.102",
"system": "SYSTEM_WINDOWS",
"channel": "STABLE"
},
{
"count": "13697",
"version": "71.0.3578.96",
"system": "SYSTEM_MAC",
"channel": "STABLE"
},
{
"count": "1",
"version": "87.0.4280.40",
"system": "SYSTEM_MAC",
"channel": "BETA"
},
{
"count": "1",
"version": "88.0.4314.0",
"system": "SYSTEM_MAC",
"channel": "CANARY"
},
{
"count": "1718"
},
],
"totalSize": 5
}
計算應用程式安裝次數的分布情形 (依權限數量)
如要查看已安裝特定應用程式且具有特定權限數量的裝置數量,請使用 filter 參數中的 number_of_permissions 值。您可以使用 pageSize 和 pageToken 參數控制結果的分頁。
如需更多篩選器參數,請參閱參考資料。
要求
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/reports:countInstalledApps?filter=number_of_permissions>6"
回應
{
"totalSize": 1,
"installedApps": [
{
"browserDeviceCount": "2",
"appSource": "CHROME_WEBSTORE",
"displayName": "Secure Shell App",
"description": "Terminal emulator and SSH and SFTP client.",
"appType": "APP",
"appInstallType": "ADMIN",
"appId": "pnhechapfaindjhompbnflcldabbghjo",
"homepageUri": "https://chrome.google.com/webstore/detail/pnhechapfaindjhompbnflcldabbghjo",
"permissions": [
"clipboardRead",
"clipboardWrite",
"crashReportPrivate",
"idle",
"metricsPrivate",
"notifications",
"storage",
"unlimitedStorage"
]
},
]
}
計算已安裝應用程式的裝置數
上例顯示應用程式已安裝在 2 部裝置上。
如要查看已安裝這個應用程式的裝置,請使用 findInstalledAppDevices 自訂方法。您可以使用 pageSize 和 pageToken 參數控制結果的分頁。
要求
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/reports:findInstalledAppDevices?appType=app&appId=pnhechapfaindjhompbnflcldabbghjo"
回應
{
"totalSize": 2,
"devices": [
{
"machine": "MACHINEA-A",
"deviceId": "b472473e-fe50-4c6e-9ac3-03fe0d0753ce"
},
{
"machine": "MACHINE-B",
"deviceId": "a5f49e54-b07b-409f-bc5c-aaf27c483249"
}
]
}
後續要求
根據上一個範例傳回的裝置 ID,您可以使用 Chrome 瀏覽器的 Admin SDK Directory API,取得已安裝應用程式的裝置相關資訊。
計算已安裝應用程式的設定檔數
如要查看已安裝應用程式的設定檔清單,可以使用 findInstalledAppProfiles 自訂方法。您可以使用 pageSize 和 pageToken 參數控制結果的分頁。
要求
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/reports:findInstalledAppProfiles?appType=app&appId=pnhechapfaindjhompbnflcldabbghjo"
回應
{
"totalSize": 2,
"profiles": [
{
"email": "<email1>",
"profileId": "ca847f92-7988-4ac8-a5a3-d0b8473c8bce",
"profilePermanentId": "agio5SHt1rlQz3WlnKV41z5Fzxw",
"profileOrgUnitId": "org_unit_id_1"
},
{
"email": "<email2>",
"profileId": "g472473e-fe50-4c6e-2ac3-53fe0d0753ce",
"profilePermanentId": "pgeo2SHt1rlQz1WlnKV41z3Fzxw",
"profileOrgUnitId": "org_unit_id_2"
},
]
}
後續要求
根據上一個範例傳回的設定檔永久 ID,您可以使用 Chrome Management Profiles API,進一步瞭解已安裝應用程式的設定檔。