Scambia un codice di autorizzazione, rinnova una sessione o autentica un client riservato
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 dei token OAuth 2.1. grant_type=authorization_code (+ PKCE S256, da Accedi con Vimine), refresh_token (rotante; un riuso revoca la famiglia), client_credentials (client riservati, HTTP Basic o nel corpo). Gli errori seguono la RFC 6749.
Corpo della richiestaobbligatorio
Sezione intitolata “Corpo della richiestaobbligatorio”Tipo di contenutoapplication/json
object
grant_type
obbligatorio
string
client_id
string
client_secret
string
code
string
code_verifier
string
redirect_uri
string formato: uri
refresh_token
string
scope
string
Risposte
Sezione intitolata “Risposte”Risposta con i token
Tipo di contenutoapplication/json
object
access_token
string
token_type
string
expires_in
integer
refresh_token
string
scope
string
sub
string
aps
L’associazione in cui il socio ha fatto l’accesso (grant authorization_code e refresh_token): il suo nome e la sua immagine, da mostrare accanto al socio
object
slug
string
name
string
picture_url
string
Esempiogenerato
{ "access_token": "example", "token_type": "example", "expires_in": 1, "refresh_token": "example", "scope": "example", "sub": "example", "aps": { "slug": "example", "name": "example", "picture_url": "example" }}Richiesta non valida
Tipo di contenutoapplication/problem+json
object
type
obbligatorio
string formato: uri
title
obbligatorio
string
status
obbligatorio
integer
detail
string
code
obbligatorio
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Esempiogenerato
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}Non trovato
Tipo di contenutoapplication/problem+json
object
type
obbligatorio
string formato: uri
title
obbligatorio
string
status
obbligatorio
integer
detail
string
code
obbligatorio
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Esempiogenerato
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}Troppe richieste
Tipo di contenutoapplication/problem+json
object
type
obbligatorio
string formato: uri
title
obbligatorio
string
status
obbligatorio
integer
detail
string
code
obbligatorio
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Esempiogenerato
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}Errore interno
Tipo di contenutoapplication/problem+json
object
type
obbligatorio
string formato: uri
title
obbligatorio
string
status
obbligatorio
integer
detail
string
code
obbligatorio
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Esempiogenerato
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}