Exchange the code, or refresh
POST
/oauth/token
const url = 'https://api.harperharbor.com/oauth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ grant_type: 'authorization_code', code: 'example', client_id: 'example', redirect_uri: 'example', code_verifier: 'example', refresh_token: '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.harperharbor.com/oauth/token \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data grant_type=authorization_code \ --data code=example \ --data client_id=example \ --data redirect_uri=example \ --data code_verifier=example \ --data refresh_token=example \ --data resource=exampleRequest Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/x-www-form-urlencoded
object
grant_type
string
code
string
client_id
string
redirect_uri
string
code_verifier
string
refresh_token
string
resource
string
Responses
Section titled “Responses”Tokens.
Media typeapplication/json
object
access_token
string
refresh_token
string
expires_in
integer
token_type
string
Example
{ "token_type": "Bearer"}