Acesse API Chrome Management Enrollment Tokens para uma visão geral dos recursos da API.
Todas as solicitações mostradas nesta página usam as seguintes variáveis:
$TOKEN: token do OAuth 2.0.$CUSTOMER: ID do cliente ou literalmy_customer
Criar um token de registro
Para criar um token de inscrição para um dispositivo navegador, use o
endpoint /enrollmentTokens com HTTP POST. Você pode especificar um parâmetro de consulta enrollmentTokenId para atribuir um ID de token personalizado.
Solicitação
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enrollmentTokens" \
-d '{
"tokenType": "ENROLLMENT_TOKEN_TYPE_CHROME_BROWSER",
"orgUnitId": "03ph8a2z3v"
}'
Resposta
{
"name": "customers/<customerId>/enrollmentTokens/<tokenPermanentId>",
"tokenPermanentId": "<tokenPermanentId>",
"token": "<tokenValue>",
"customerId": "<customerId>",
"orgUnitId": "03ph8a2z3v",
"state": "ENROLLMENT_TOKEN_STATE_ACTIVE",
"createTime": "2024-04-23T22:00:00.000Z",
"creatorId": "user@example.com",
"tokenType": "ENROLLMENT_TOKEN_TYPE_CHROME_BROWSER"
}
Recuperar um token de registro
Para recuperar um único token de inscrição, use o
endpoint /enrollmentTokens/{token_permanent_id} com HTTP GET.
Solicitação
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enrollmentTokens/<tokenPermanentId>"
Resposta
{
"name": "customers/<customerId>/enrollmentTokens/<tokenPermanentId>",
"tokenPermanentId": "<tokenPermanentId>",
"token": "<tokenValue>",
"customerId": "<customerId>",
"orgUnitId": "03ph8a2z3v",
"state": "ENROLLMENT_TOKEN_STATE_ACTIVE",
"createTime": "2024-04-23T22:00:00.000Z",
"creatorId": "user@example.com",
"tokenType": "ENROLLMENT_TOKEN_TYPE_CHROME_BROWSER"
}
Listar tokens de inscrição
Para listar os tokens de inscrição, use o endpoint /enrollmentTokens com HTTP GET.
É possível controlar a paginação usando os parâmetros pageSize (máximo e padrão de 100) e pageToken. Especifique um filter para restringir os resultados.
Exemplos de consultas de filtro
# Filter by token state
filter=token_state=ACTIVE
# Filter by Organizational Unit path
filter=org_unit_path=/Marketing
# Filter by Organizational Unit path containing spaces
filter=org_unit_path='/Browser Management'
# Filter by Organizational Unit ID
filter=org_unit_id=03ph8a2z3v
# Filter by token state, Organizational Unit path, and device type
filter=token_state=ACTIVE AND org_unit_path=/Marketing AND device_type=CHROME_BROWSER
Solicitação
curl -X GET \
-H "Authorization: Bearer $TOKEN" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enrollmentTokens?pageSize=2&filter=token_state=ACTIVE"
Resposta
{
"enrollmentTokens": [
{
"name": "customers/<customerId>/enrollmentTokens/<tokenPermanentId1>",
"tokenPermanentId": "<tokenPermanentId1>",
"token": "<tokenValue1>",
"customerId": "<customerId>",
"orgUnitId": "03ph8a2z3v",
"state": "ENROLLMENT_TOKEN_STATE_ACTIVE",
"createTime": "2024-04-23T22:00:00.000Z",
"creatorId": "user1@example.com",
"tokenType": "ENROLLMENT_TOKEN_TYPE_CHROME_BROWSER"
},
{
"name": "customers/<customerId>/enrollmentTokens/<tokenPermanentId2>",
"tokenPermanentId": "<tokenPermanentId2>",
"token": "<tokenValue2>",
"customerId": "<customerId>",
"orgUnitId": "03ph8a2z3v",
"state": "ENROLLMENT_TOKEN_STATE_ACTIVE",
"createTime": "2024-04-23T21:30:00.000Z",
"creatorId": "user2@example.com",
"tokenType": "ENROLLMENT_TOKEN_TYPE_CHROME_BROWSER"
}
],
"nextPageToken": "<nextPageToken>"
}
Revogar um token de registro
Para revogar um token de inscrição, use o
endpoint /enrollmentTokens/{token_permanent_id}:revoke com HTTP POST.
Solicitação
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
"https://chromemanagement.googleapis.com/v1/customers/$CUSTOMER/enrollmentTokens/<tokenPermanentId>:revoke" \
-d '{}'
Resposta
{
"name": "customers/<customerId>/enrollmentTokens/<tokenPermanentId>",
"tokenPermanentId": "<tokenPermanentId>",
"token": "<tokenValue>",
"customerId": "<customerId>",
"orgUnitId": "03ph8a2z3v",
"state": "ENROLLMENT_TOKEN_STATE_REVOKED",
"createTime": "2024-04-23T22:00:00.000Z",
"revokeTime": "2024-04-24T10:15:00.000Z",
"creatorId": "user@example.com",
"revokerId": "admin@example.com",
"tokenType": "ENROLLMENT_TOKEN_TYPE_CHROME_BROWSER"
}