Pular para o conteúdo

Obter access token (client credentials)

POST
/v1/oauth/token
curl --request POST \
--url https://sandbox-api.eagleix-corban.com.br/v1/oauth/token \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials

Envie as credenciais no header Authorization: Basic base64(client_id:client_secret) (recomendado) ou no corpo (client_id e client_secret), nunca nos dois.

object
grant_type
required
string
Allowed value: client_credentials
client_id

Só se não usar o header Basic.

string
client_secret

Só se não usar o header Basic.

string

Example

grant_type=client_credentials

Token emitido.

Tipo de mídiaapplication/json
object
access_token
required

Token opaco (prefixo cbt_).

string
token_type
required
string
Allowed value: Bearer
expires_in
required

Validade em segundos.

integer

Example

{
"token_type": "Bearer",
"expires_in": 3600
}
Cache-Control
string
Allowed value: no-store

Requisição inválida (invalid_request) ou grant não suportado (unsupported_grant_type).

Tipo de mídiaapplication/json
object
error
required

Código de erro OAuth 2.0 (RFC 6749, seção 5.2).

string
error_description
string
requestId
string

Example

{
"error": "unsupported_grant_type",
"error_description": "só client_credentials é suportado",
"requestId": "8d1f0c2a9b7e4c3d2a1b0f9e"
}

Credenciais inválidas (invalid_client). Por segurança a resposta é a mesma para client_id inexistente, secret errado, canal inativo ou IP não permitido.

Tipo de mídiaapplication/json
object
error
required

Código de erro OAuth 2.0 (RFC 6749, seção 5.2).

string
error_description
string
requestId
string

Example

{
"error": "invalid_client",
"error_description": "credenciais do cliente inválidas",
"requestId": "8d1f0c2a9b7e4c3d2a1b0f9e"
}

Bloqueio temporário por excesso de tentativas inválidas.

Tipo de mídiaapplication/json
object
error
required

Código de erro OAuth 2.0 (RFC 6749, seção 5.2).

string
error_description
string
requestId
string

Example

{
"error": "too_many_attempts",
"error_description": "muitas tentativas inválidas; tente mais tarde",
"requestId": "8d1f0c2a9b7e4c3d2a1b0f9e"
}
Retry-After
integer

Segundos até poder tentar de novo.

Banco indisponível.

Tipo de mídiaapplication/json
object
error
required

Código de erro OAuth 2.0 (RFC 6749, seção 5.2).

string
error_description
string
requestId
string

Example

{
"error": "invalid_request"
}