Introspect a token
curl --request POST \
--url https://api.swapnice.com/oauth/introspect \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'token=<string>'const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({token: '<string>'})
};
fetch('https://api.swapnice.com/oauth/introspect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/oauth/introspect"
payload = { "token": "<string>" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"active": true,
"scope": "<string>",
"client_id": "<string>",
"username": "<string>",
"token_type": "<string>",
"exp": 123,
"iat": 123,
"sub": "<string>",
"aud": "<string>",
"iss": "<string>"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}OAuth
Introspect a token
Confirm a token is active and inspect its scopes.
POST
/
oauth
/
introspect
Introspect a token
curl --request POST \
--url https://api.swapnice.com/oauth/introspect \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'token=<string>'const options = {
method: 'POST',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({token: '<string>'})
};
fetch('https://api.swapnice.com/oauth/introspect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/oauth/introspect"
payload = { "token": "<string>" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"active": true,
"scope": "<string>",
"client_id": "<string>",
"username": "<string>",
"token_type": "<string>",
"exp": 123,
"iat": 123,
"sub": "<string>",
"aud": "<string>",
"iss": "<string>"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Confirm a token is active and inspect its scopes.
Requires
tokens:introspect. Use this in sandbox to verify the token you just issued.Authorizations
BasicAuthOAuth2
Client authentication for confidential OAuth clients.
Body
application/x-www-form-urlencoded
⌘I