Token
POST
/oauth/tokenRequest body
requiredapplication/jsongrant_typestringrequiredOAuth2 grant type.
Allowed:
authorization_coderefresh_tokenclient_idstringrequiredclient_secretstringRequired for confidential clients. Public clients send a code_verifier instead.
codestringRequired when grant_type is 'authorization_code'.
redirect_uristringRequired when grant_type is 'authorization_code'. Must match the redirect URI given with code.
refresh_tokenstringRequired when grant_type is 'refresh_token'.
code_verifierstringPKCE verifier (RFC 7636). Required when the code was issued with a challenge, which is always the case for public clients.
min length 43 · max length 128
Responses
200Access and refresh tokens
access_tokenstringrequiredrefresh_tokenstringrequiredtoken_typestringrequiredexpires_innumberrequiredAccess token lifetime in seconds
scopestringrequiredTry it
Server
Bodyapplication/json
Request
curl -X POST "https://api.insy.io/oauth/token" \
-H "Content-Type: application/json" \
-d '{
"grant_type": "authorization_code",
"client_id": "string",
"client_secret": "string",
"code": "string",
"redirect_uri": "string",
"refresh_token": "string",
"code_verifier": "stringstringstringstringstringstringstrings"
}'const response = await fetch("https://api.insy.io/oauth/token", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"grant_type": "authorization_code",
"client_id": "string",
"client_secret": "string",
"code": "string",
"redirect_uri": "string",
"refresh_token": "string",
"code_verifier": "stringstringstringstringstringstringstrings"
})
});import requests
response = requests.post(
"https://api.insy.io/oauth/token",
headers={
"Content-Type": "application/json"
},
json={
"grant_type": "authorization_code",
"client_id": "string",
"client_secret": "string",
"code": "string",
"redirect_uri": "string",
"refresh_token": "string",
"code_verifier": "stringstringstringstringstringstringstrings"
},
)Response
{
"access_token": "Qdo7OGjdzi9iurSsag6BInEIPiHp-yFIDTkpQG4nAFU",
"refresh_token": "Jp36TmRIf7IvKKcUdRanxDH1WNOqKIuaZUp2OcgksAA",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "memberships.read"
}