Trocar um código de autorização, renovar uma sessão ou autenticar um cliente confidencial
POST
/v1/oauth/token
const url = 'https://api.vimine.network/v1/oauth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Corpo da requisiçãoobrigatório
Seção intitulada “Corpo da requisiçãoobrigatório”Tipo de mídiaapplication/json
object
grant_type
obrigatório
string
client_id
string
client_secret
string
code
string
code_verifier
string
redirect_uri
string formato: uri
refresh_token
string
scope
string
Respostas
Seção intitulada “Respostas”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" } ]}