Exchange an authorization code, refresh a session, or authenticate a confidential client
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" }'OAuth 2.1 token endpoint. grant_type=authorization_code (+ PKCE S256, from Accedi con Vimine), refresh_token (rotating; reuse revokes the family), client_credentials (confidential clients, HTTP Basic or body). Errors follow RFC 6749.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
grant_type
required
string
client_id
string
client_secret
string
code
string
code_verifier
string
redirect_uri
string format: uri
refresh_token
string
scope
string
Responses
Section titled “Responses”Token response
Media typeapplication/json
object
access_token
string
token_type
string
expires_in
integer
refresh_token
string
scope
string
sub
string
aps
The association the member signed in to (authorization_code and refresh_token grants): its name and picture to show beside the member
object
slug
string
name
string
picture_url
string
Examplegenerated
{ "access_token": "example", "token_type": "example", "expires_in": 1, "refresh_token": "example", "scope": "example", "sub": "example", "aps": { "slug": "example", "name": "example", "picture_url": "example" }}Invalid request
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
detail
string
code
required
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}Not found
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
detail
string
code
required
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}Rate limited
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
detail
string
code
required
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}Internal error
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
detail
string
code
required
string
request_id
string
errors
Array<object>
object
field
string
code
string
message
string
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}