Oauth Token
POST
/api/oauth/token
const url = 'https://example.com/api/oauth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ client_id: 'example', client_secret: 'example', code: 'example', grant_type: 'example', redirect_uri: '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://example.com/api/oauth/token \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data client_id=example \ --data client_secret=example \ --data code=example \ --data grant_type=example \ --data redirect_uri=exampleOAuth2 Token endpoint.
Exchanges authorization code for access token.
Request Bodyrequired
Section titled “ Request Bodyrequired ” Media type application/x-www-form-urlencoded
Body_oauth_token_api_oauth_token_post
object
Example generated
client_id=example&client_secret=example&code=example&grant_type=example&redirect_uri=exampleResponses
Section titled “ Responses ”Successful Response
Media type application/json
Example generated
exampleValidation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}