Exemplos de código para a API Chrome Management Reports
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Acesse a API Chrome Management Reports para
uma visão geral dos recursos da API.
Todas as solicitações mostradas abaixo usam as seguintes variáveis:
$TOKEN
: token OAuth 2
$CUSTOMER
: ID do cliente ou my_customer
literal
$ORG_UNIT_ID
: ID de uma unidade organizacional específica para a qual você quer gerar uma solicitação.
Contar versões do Chrome ativas no período
Para saber quais versões do Chrome estavam ativas em um determinado período, faça o seguinte:
use o valor last_active_date
no parâmetro filter
. Você pode controlar
paginação dos resultados usando os parâmetros pageSize
e pageToken
.
Solicitação
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"
Resposta
{
"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
}
Contar a distribuição de instalações de apps com um número de permissões
Para conferir o número de dispositivos que instalaram um app específico com uma determinada
número de permissões, use o valor number_of_permissions
no campo
parâmetro filter
. Você pode controlar a paginação dos resultados usando o
Parâmetros pageSize
e pageToken
.
Para mais parâmetros de filtro, acesse a
referência.
Solicitação
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/reports:countInstalledApps?filter=number_of_permissions>6"
Resposta
{
"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"
]
},
]
}
Contar dispositivos que têm um app instalado
O exemplo anterior mostrou um app instalado em dois dispositivos.
Para ver os dispositivos que instalaram este aplicativo, você pode usar o
Método personalizado findInstalledAppDevices
.
É possível controlar a paginação dos resultados usando pageSize
e pageToken
.
parâmetros.
Solicitação
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/reports:findInstalledAppDevices?appType=app&appId=pnhechapfaindjhompbnflcldabbghjo"
Resposta
{
"totalSize": 2,
"devices": [
{
"machine": "MACHINEA-A",
"deviceId": "b472473e-fe50-4c6e-9ac3-03fe0d0753ce"
},
{
"machine": "MACHINE-B",
"deviceId": "a5f49e54-b07b-409f-bc5c-aaf27c483249"
}
]
}
Solicitação de acompanhamento
Com o ID do dispositivo retornado no exemplo anterior, é possível receber mais
informações sobre o dispositivo que instalou o app usando o
API Admin SDK Directory para navegadores Chrome.
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-25 UTC.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-07-25 UTC."],[[["\u003cp\u003eUse the Chrome Management Reports API to retrieve data on Chrome browser and app usage within your organization.\u003c/p\u003e\n"],["\u003cp\u003eThe API allows you to count Chrome versions active within a specified date range, filter by criteria like the number of app permissions, and identify devices with specific apps installed.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the \u003ccode\u003ecountChromeVersions\u003c/code\u003e, \u003ccode\u003ecountInstalledApps\u003c/code\u003e, and \u003ccode\u003efindInstalledAppDevices\u003c/code\u003e methods for gathering data insights.\u003c/p\u003e\n"],["\u003cp\u003eDetailed information about specific devices can be retrieved through the Admin SDK Directory API using the device ID.\u003c/p\u003e\n"]]],[],null,["# Code Samples for the Chrome Management Reports API\n\nVisit [Chrome Management Reports API](/chrome/management/guides/reports_api) for\nan overview of API features.\n\nAll the requests shown below use the following variables:\n\n- `$TOKEN` - OAuth 2 token\n- `$CUSTOMER` - ID of the customer or literal `my_customer`\n- `$ORG_UNIT_ID` - ID of a particluar org unit for which you want to generate a request.\n\nCount Chrome versions active in date range\n------------------------------------------\n\nTo view which Chrome versions were active over a given range of time,\nuse the `last_active_date` value in the `filter` parameter. You can control\npagination of the results using the `pageSize` and `pageToken` parameters.\n\n#### Request\n\n curl -X GET \\\n -H \"Authorization: Bearer $TOKEN\" \\\n \"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/reports:countChromeVersions?filter=last_active_date\u003c2020-11-06+AND+last_active_date\u003e2020-11-04\"\n\n#### Response\n\n {\n \"browserVersions\": [\n {\n \"count\": \"1\",\n \"version\": \"85.0.4183.83\",\n \"system\": \"SYSTEM_MAC\",\n \"channel\": \"STABLE\"\n },\n {\n \"count\": \"1\",\n \"version\": \"85.0.4183.102\",\n \"system\": \"SYSTEM_WINDOWS\",\n \"channel\": \"STABLE\"\n },\n {\n \"count\": \"13697\",\n \"version\": \"71.0.3578.96\",\n \"system\": \"SYSTEM_MAC\",\n \"channel\": \"STABLE\"\n },\n {\n \"count\": \"1\",\n \"version\": \"87.0.4280.40\",\n \"system\": \"SYSTEM_MAC\",\n \"channel\": \"BETA\"\n },\n {\n \"count\": \"1\",\n \"version\": \"88.0.4314.0\",\n \"system\": \"SYSTEM_MAC\",\n \"channel\": \"CANARY\"\n },\n {\n \"count\": \"1718\"\n },\n ],\n \"totalSize\": 5\n }\n\nCount distribution of app installations with a number of permissions\n--------------------------------------------------------------------\n\nTo view the number of devices that have installed a particular app with a given\nnumber of permissions, use the `number_of_permissions` value in the\n`filter` parameter. You can control pagination of the results using the\n`pageSize` and `pageToken` parameters.\n\nFor more filter parameters, visit the\n[reference](/chrome/management/reference/rest/v1/customers.reports/countInstalledApps).\n\n#### Request\n\n curl -X GET \\\n -H \"Authorization: Bearer $TOKEN\" \\\n \"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/reports:countInstalledApps?filter=number_of_permissions\u003e6\"\n\n#### Response\n\n {\n \"totalSize\": 1,\n \"installedApps\": [\n {\n \"browserDeviceCount\": \"2\",\n \"appSource\": \"CHROME_WEBSTORE\",\n \"displayName\": \"Secure Shell App\",\n \"description\": \"Terminal emulator and SSH and SFTP client.\",\n \"appType\": \"APP\",\n \"appInstallType\": \"ADMIN\",\n \"appId\": \"pnhechapfaindjhompbnflcldabbghjo\",\n \"homepageUri\": \"https://chrome.google.com/webstore/detail/pnhechapfaindjhompbnflcldabbghjo\",\n \"permissions\": [\n \"clipboardRead\",\n \"clipboardWrite\",\n \"crashReportPrivate\",\n \"idle\",\n \"metricsPrivate\",\n \"notifications\",\n \"storage\",\n \"unlimitedStorage\"\n ]\n },\n ]\n }\n\nCount devices that have an installed app\n----------------------------------------\n\nThe previous example showed an app that has been installed on 2 devices.\nTo view the devices that have installed this app, you can use the\n`findInstalledAppDevices` custom method.\nYou can control pagination of the results using the `pageSize` and `pageToken`\nparameters.\n\n#### Request\n\n curl -X GET \\\n -H \"Authorization: Bearer $TOKEN\" \\\n \"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/reports:findInstalledAppDevices?appType=app&appId=pnhechapfaindjhompbnflcldabbghjo\"\n\n#### Response\n\n {\n \"totalSize\": 2,\n \"devices\": [\n {\n \"machine\": \"MACHINEA-A\",\n \"deviceId\": \"b472473e-fe50-4c6e-9ac3-03fe0d0753ce\"\n },\n {\n \"machine\": \"MACHINE-B\",\n \"deviceId\": \"a5f49e54-b07b-409f-bc5c-aaf27c483249\"\n }\n ]\n }\n\n### Follow-up request\n\nGiven the device ID returned in the previous example, you can get more\ninformation about the device that has installed the app by using the\n[Admin SDK Directory API for Chrome Browsers](/admin-sdk/directory/v1/guides/manage-chrome-browsers)."]]