Visita la API de Chrome Management Profiles para obtener una descripción general de las funciones de la API.
Todas las solicitudes que se muestran en esta página usan las siguientes variables:
$TOKEN
: Es el token de OAuth 2.0.$CUSTOMER
: Es el ID del cliente o el literalmy_customer
.
Cómo enumerar perfiles administrados
Para enumerar los perfiles administrados, usa el extremo /profiles
. Puedes controlar la paginación de los resultados con los parámetros pageSize
y pageToken
. Usa orderBy
para especificar el orden de los resultados. Especifica un filter
para reducir aún más los resultados. Se puede especificar una máscara de lectura con el parámetro de consulta fields
. Ten en cuenta que se puede mejorar la eficiencia si se enumeran los perfiles con una máscara de lectura que excluya el campo reportingData
.
Solicitud
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"
Respuesta
{
"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"
}
Cómo recuperar un perfil administrado
Para recuperar un perfil administrado, usa el extremo /profiles/{profile_permanent_id}
. Se puede especificar una máscara de lectura con el parámetro fields
.
Solicitud
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"
Respuesta
{
"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"
}
Cómo borrar los datos recopilados de un perfil administrado
Para borrar los datos recopilados de un perfil administrado, usa el extremo /profiles/{profile_permanent_id}
.
Solicitud
curl -X DELETE \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/profiles/<profilePermanentId1>"