Обзор функций API см. на странице Chrome Management Profiles API .
Все запросы, показанные на этой странице, используют следующие переменные:
-
$TOKEN
— токен OAuth 2.0 -
$CUSTOMER
- идентификатор клиента или буквальноmy_customer
Список управляемых профилей
Чтобы составить список управляемых профилей, используйте конечную точку /profiles
. Вы можете управлять разбиением результатов на страницы с помощью параметров pageSize
и pageToken
. Используйте orderBy
для указания порядка результатов. Для дальнейшего сужения результатов задайте filter
. Маску чтения можно указать с помощью параметра запроса fields
. Обратите внимание, что эффективность можно повысить, перечислив профили с маской чтения, исключающей поле reportingData
.
Запрос
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/profiles?pageSize=2&orderBy=lastPolicySyncTime&filter=osPlatformType=WINDOWS+AND+affiliationState=PROFILE_ONLY&fields=chromeBrowserProfiles.name,chromeBrowserProfiles.profileId,chromeBrowserProfiles.profilePermanentId,chromeBrowserProfiles.displayName,chromeBrowserProfiles.userEmail,chromeBrowserProfiles.lastActivityTime,chromeBrowserProfiles.osPlatformType,chromeBrowserProfiles.policyCount,chromeBrowserProfiles.reportingData,chromeBrowserProfiles.identityProvider,chromeBrowserProfiles.affiliationState"
Ответ
{
"chromeBrowserProfiles": [
{
"name": "customers/<customerId>/profiles/<profilePermanentId1>",
"profileId": "<profileId1>",
"profilePermanentId": "<profilePermanentId1>",
"displayName": "My profile 1",
"userEmail": "<userEmail1>",
"lastActivityTime": "2024-04-23T22:05:44.214362Z",
"osPlatformType": "WINDOWS",
"policyCount": "2",
"reportingData": [
{
"browserExecutablePath": "<executablePath1>",
"profilePath": "<profilePath1>",
"extensionData":[
{
"extensionId": "ghbmnnjooekpmoecnnnilnnbdlolhkhi",
"version": "1.76.1",
"name": "Google Docs Offline",
"extensionType": "EXTENSION",
"homepageUri": "https://chrome.google.com/webstore/detail/ghbmnnjooekpmoecnnnilnnbdlolhkhi",
"installationType": "NORMAL",
"isDisabled": true,
"isWebstoreExtension": true,
"manifestVersion": 3
}
],
"policyData":[
{
"source": "MACHINE_PLATFORM",
"name": "AutoSelectCertificateForUrls",
"value": "\"********\""
},
{
"source": "USER_CLOUD",
"name": "BrowserThemeColor",
"value": "\"#00FF00\""
}
]
}
],
"identityProvider": "GOOGLE_IDENTITY_PROVIDER",
"affiliationState": "PROFILE_ONLY"
},
{
"name": "customers/<customerId>/profiles/<profilePermanentId2>",
"profileId": "<profileId2>",
"profilePermanentId": "<profilePermanentId2>",
"displayName": "My profile 2",
"userEmail": "<userEmail2>",
"lastActivityTime": "2024-04-23T22:05:44.214362Z",
"osPlatformType": "WINDOWS",
"policyCount": "1",
"reportingData": [
{
"browserExecutablePath": "<executablePath2>",
"profilePath": "<profilePath2>",
"policyData":[
{
"source": "USER_CLOUD",
"name": "CloudProfileReportingEnabled",
"value": "true"
}
]
}
],
"identityProvider": "GOOGLE_IDENTITY_PROVIDER",
"affiliationState": "PROFILE_ONLY"
}
],
"next_page_token": "<nextPageToken>",
"total_size": "120"
}
Получить управляемый профиль
Для получения управляемого профиля используйте конечную точку /profiles/{profile_permanent_id}
. Маску чтения можно указать с помощью параметра fields
.
Запрос
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/profiles/<profilePermanentId1>?fields=chromeBrowserProfiles.name,chromeBrowserProfiles.profileId,chromeBrowserProfiles.profilePermanentId,chromeBrowserProfiles.displayName,chromeBrowserProfiles.userEmail,chromeBrowserProfiles.lastActivityTime,chromeBrowserProfiles.osPlatformType,chromeBrowserProfiles.policyCount,chromeBrowserProfiles.reportingData,chromeBrowserProfiles.identityProvider,chromeBrowserProfiles.affiliationState"
Ответ
{
"name": "customers/<customerId>/profiles/<profilePermanentId1>",
"profileId": "<profileId1>",
"profilePermanentId": "<profilePermanentId1>",
"displayName": "My profile 1",
"userEmail": "<userEmail1>",
"lastActivityTime": "2024-04-23T22:05:44.214362Z",
"osPlatformType": "WINDOWS",
"policyCount": "2",
"reportingData": [
{
"browserExecutablePath": "<executablePath1>",
"profilePath": "<profilePath1>",
"extensionData":[
{
"extensionId": "ghbmnnjooekpmoecnnnilnnbdlolhkhi",
"version": "1.76.1",
"name": "Google Docs Offline",
"extensionType": "EXTENSION",
"homepageUri": "https://chrome.google.com/webstore/detail/ghbmnnjooekpmoecnnnilnnbdlolhkhi",
"installationType": "NORMAL",
"isDisabled": true,
"isWebstoreExtension": true,
"manifestVersion": 3
}
],
"policyData":[
{
"source": "MACHINE_PLATFORM",
"name": "AutoSelectCertificateForUrls",
"value": "\"********\""
},
{
"source": "USER_CLOUD",
"name": "BrowserThemeColor",
"value": "\"#00FF00\""
}
]
}
],
"identityProvider": "GOOGLE_IDENTITY_PROVIDER",
"affiliationState": "PROFILE_ONLY"
}
Удалить данные, собранные из управляемого профиля
Чтобы удалить данные, собранные из управляемого профиля, используйте конечную точку /profiles/{profile_permanent_id}
.
Запрос
curl -X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/profiles/<profilePermanentId1>"
Выполнение удаленной команды для управляемого профиля
Чтобы выдать удаленную команду управляемому профилю, используйте конечную точку /profiles/{profile_permanent_id}/commands/
.
Запрос
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
--data '{"command_type":"clearBrowsingData", "payload":{clearCache:true, clearCookies:true}}' \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/profiles/<profilePermanentId1>/commands"
Ответ
{
"name": "customers/<customerId>/profiles/<profilePermanentId1>/commands/<commandId1>",
"commandType": "clear_browsing_data",
"payload": {
"clear_cache": true,
"clear_cookies": true
},
"commandState": "PENDING",
"issueTime": "2025-04-05T16:43:37.668Z",
"validDuration": "86400s"
}
Извлечение удаленной команды, отправленной управляемому профилю
Чтобы получить удаленную команду, выданную управляемому профилю, используйте конечную точку /profiles/{profile_permanent_id}/commands/{command_id}
.
Запрос
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/profiles/<profilePermanentId1>/commands/<commandId1>"
Ответ
{
"name": "customers/<customerId>/profiles/<profilePermanentId1>/commands/<commandId1>",
"commandType": "clear_browsing_data",
"payload": {
"clear_cache": true,
"clear_cookies": true
},
"commandState": "EXECUTED_BY_CLIENT",
"commandResult": {
"resultType": "SUCCESS",
"clientExecutionTime": "2025-04-05T14:01:51.082Z"
},
"issueTime": "2025-04-05T14:01:49.914Z",
"validDuration": "86400s"
}
Список удаленных команд, выданных управляемому профилю
Чтобы вывести список удаленных команд, выданных управляемому профилю, используйте конечную точку /profiles/{profile_permanent_id}/commands
.
Запрос
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/profiles/<profilePermanentId1>/commands?pageSize=2"
Ответ
{
"chromeBrowserProfileCommands": [
{
"name": "customers/<customerId>/profiles/<profilePermanentId1>/commands/<commandId1>",
"commandType": "clear_browsing_data",
"payload": {
"clear_cache": true,
"clear_cookies": true
},
"commandState": "EXECUTED_BY_CLIENT",
"commandResult": {
"resultType": "SUCCESS",
"clientExecutionTime": "2025-04-05T14:01:51.082Z"
},
"issueTime": "2025-04-05T14:01:49.914Z",
"validDuration": "86400s"
},
{
"name": "customers/<customerId>/profiles/<profilePermanentId1>/commands/<commandId2>",
"commandType": "clear_browsing_data",
"payload": {
"clear_cache": true,
"clear_cookies": false
},
"commandState": "EXECUTED_BY_CLIENT",
"commandResult": {
"resultType": "SUCCESS",
"clientExecutionTime": "2025-04-05T14:02:59.981Z"
},
"issueTime": "2025-04-05T14:02:59.192Z",
"validDuration": "86400s"
}
],
"nextPageToken": "<nextPageToken>",
"totalSize": "10"
}