For the complete documentation index, see llms.txt. This page is also available as Markdown.

Solicitar token de acesso

Retorne um token bearer OAuth 2.0 para uma conta de serviço da API.

Os tokens são emitidos usando a concessão de credenciais do cliente, que autentica sua conta de serviço em vez de um usuário individual.

Request a token

post

Exchange your Base64-encoded service account credentials for an OAuth2 access token.

Parâmetros de cabeçalho
AuthorizationstringObrigatório

Enter Basic, a space, and your Base64-encoded ClientID:ClientSecret (the only value you need to edit).

Default: Basic <Base64Encoded(ClientID:ClientSecret)>
Corpo
grant_typestringObrigatório

The OAuth2 grant type. Always client_credentials, because your service account authenticates as itself rather than on behalf of a user.

scopestringObrigatório

The scope of the access token. Always api/api.

Respostas
200

An access token was issued.

application/json
access_tokenstringObrigatório

The bearer token to send on every API request.

token_typestringObrigatório

The type of token issued.

Example: Bearer
expires_inintegerObrigatório

The lifetime of the token in seconds. Tokens are issued with a lifetime of one hour.

Example: 3600
post/oauth2/token
POST /oauth2/token HTTP/1.1
Host: eseye-idp-prod.auth.eu-west-1.amazoncognito.com
Authorization: Basic <Base64Encoded(ClientID:ClientSecret)>
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 53

"grant_type='client_credentials'&scope='api/api'"
{
  "access_token": "eyJraWQiOiJhYmMxMjMiLCJhbGciOiJSUzI1NiJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}

Retorna um token bearer OAuth 2.0 para uma conta de serviço da API.

POST /oauth2/token

Ponto de extremidade

Substitua <region> pela região da AWS fornecida pela Eseye.

Cabeçalhos da requisição

Cabeçalho
Valor
Obrigatório

Autorização

Basic <credentials>

Sim

Content-Type

application/x-www-form-urlencoded

Sim

<credentials> é a forma codificada em Base64 de <client-id>:<client-secret>.

Parâmetros de formulário

Parâmetro
Valor
Obrigatório
Descrição

grant_type

client_credentials

Sim

Autentica a conta de serviço.

scope

api/api

Sim

Solicita acesso à API da Eseye.

Exemplo de requisição

Resposta bem-sucedida

Uma requisição aceita retorna HTTP 200:

Reutilize o token até ele expirar e, então, solicite outro token.

Resposta de erro

O ponto de extremidade retorna HTTP 400 quando rejeita uma requisição. Um invalid_client erro significa que as credenciais não foram aceitas.

Atualizado

Isto foi útil?