Token
POST
/oauth/token
const url = 'https://example.com/oauth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ client_id: '', code: '', code_verifier: '', grant_type: '', redirect_uri: '', refresh_token: '', resource: '' })};
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://example.com/oauth/token \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data client_id= \ --data code= \ --data code_verifier= \ --data grant_type= \ --data redirect_uri= \ --data refresh_token= \ --data resource=Request Body
Section titled “Request Body”Media typeapplication/x-www-form-urlencoded
Body_token_oauth_token_post
object
client_id
Client Id
string
code
Code
string
code_verifier
Code Verifier
string
grant_type
Grant Type
string
redirect_uri
Redirect Uri
string
refresh_token
Refresh Token
string
resource
Resource
string
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Examplegenerated
exampleValidation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}