Ir al contenido

Intercambiar un código de autorización, renovar una sesión o autenticar un 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 de OAuth 2.1. grant_type=authorization_code (+ PKCE S256, desde Iniciar sesión con Vimine), refresh_token (rotativo; reutilizarlo revoca la familia), client_credentials (clientes confidenciales, HTTP Basic o en el cuerpo). Los errores siguen el RFC 6749.

Tipo de medioapplication/json
object
grant_type
obligatorio
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

Respuesta de token

Tipo de medioapplication/json
object
access_token
string
token_type
string
expires_in
integer
refresh_token
string
scope
string
sub
string
Ejemplogenerado
{
"access_token": "example",
"token_type": "example",
"expires_in": 1,
"refresh_token": "example",
"scope": "example",
"sub": "example"
}

Petición no válida

Tipo de medioapplication/problem+json
object
type
obligatorio
string formato: uri
title
obligatorio
string
status
obligatorio
integer
detail
string
code
obligatorio
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Ejemplogenerado
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

No encontrado

Tipo de medioapplication/problem+json
object
type
obligatorio
string formato: uri
title
obligatorio
string
status
obligatorio
integer
detail
string
code
obligatorio
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Ejemplogenerado
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

Límite de frecuencia superado

Tipo de medioapplication/problem+json
object
type
obligatorio
string formato: uri
title
obligatorio
string
status
obligatorio
integer
detail
string
code
obligatorio
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Ejemplogenerado
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}

Error interno

Tipo de medioapplication/problem+json
object
type
obligatorio
string formato: uri
title
obligatorio
string
status
obligatorio
integer
detail
string
code
obligatorio
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Ejemplogenerado
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"errors": [
{
"field": "example",
"code": "example",
"message": "example"
}
]
}