Pular para o conteúdo

Trocar um código de autorização, renovar uma sessão ou autenticar um cliente confidencial

POST
/v1/oauth/token
curl --request POST \
--url https://api.vimine.network/v1/oauth/token \
--header 'Content-Type: application/json' \
--data '{ "grant_type": "authorization_code", "client_id": "example", "client_secret": "example", "code": "example", "code_verifier": "example", "redirect_uri": "https://example.com", "refresh_token": "example", "scope": "example" }'

Endpoint de token OAuth 2.1. grant_type=authorization_code (+ PKCE S256, do Entrar com Vimine), refresh_token (rotativo; reutilizá-lo revoga a família), client_credentials (clientes confidenciais, HTTP Basic ou no corpo). Os erros seguem a RFC 6749.

Tipo de mídiaapplication/json
object
grant_type
obrigatório
string
Valores permitidos: authorization_code refresh_token client_credentials
client_id
string
client_secret
string
code
string
code_verifier
string
redirect_uri
string formato: uri
refresh_token
string
scope
string

Resposta de token

Tipo de mídiaapplication/json
object
access_token
string
token_type
string
expires_in
integer
refresh_token
string
scope
string
sub
string
Exemplogerado
{
"access_token": "example",
"token_type": "example",
"expires_in": 1,
"refresh_token": "example",
"scope": "example",
"sub": "example"
}

Requisição inválida

Tipo de mídiaapplication/problem+json
object
type
obrigatório
string formato: uri
title
obrigatório
string
status
obrigatório
integer
detail
string
code
obrigatório
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Exemplogerado
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

Não encontrado

Tipo de mídiaapplication/problem+json
object
type
obrigatório
string formato: uri
title
obrigatório
string
status
obrigatório
integer
detail
string
code
obrigatório
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Exemplogerado
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

Limite de requisições excedido

Tipo de mídiaapplication/problem+json
object
type
obrigatório
string formato: uri
title
obrigatório
string
status
obrigatório
integer
detail
string
code
obrigatório
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Exemplogerado
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

Erro interno

Tipo de mídiaapplication/problem+json
object
type
obrigatório
string formato: uri
title
obrigatório
string
status
obrigatório
integer
detail
string
code
obrigatório
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Exemplogerado
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}