Exchange an authorization code or refresh token
POST
/oauth/token
const url = 'https://api.muninx.com/oauth/token';const options = { method: 'POST', headers: { Authorization: 'Bearer <token>', 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ grant_type: 'authorization_code', code: 'example', refresh_token: 'example', client_id: 'example', redirect_uri: 'example', code_verifier: 'example', resource: '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.muninx.com/oauth/token \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data grant_type=authorization_code \ --data code=example \ --data refresh_token=example \ --data client_id=example \ --data redirect_uri=example \ --data code_verifier=example \ --data resource=exampleAuthorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/x-www-form-urlencoded
object
grant_type
required
string
code
string
refresh_token
string
client_id
required
string
redirect_uri
string
code_verifier
string
resource
string
Responses
Section titled “ Responses ”Token response
Media type application/json
object
access_token
required
string
token_type
required
string
expires_in
required
integer format: int64
refresh_token
string
scope
required
string
Example generated
{ "access_token": "example", "token_type": "example", "expires_in": 1, "refresh_token": "example", "scope": "example"}Problem response
Media type application/problem+json
object
key
additional properties
any
Example generated
{}