Revoke an OAuth token
curl --request POST \
--url https://api.swapnice.com/oauth/revoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'token=<string>'const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({token: '<string>'})
};
fetch('https://api.swapnice.com/oauth/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/oauth/revoke"
payload = { "token": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}OAuth
Revoke a token
Invalidate an access or refresh token.
POST
/
oauth
/
revoke
Revoke an OAuth token
curl --request POST \
--url https://api.swapnice.com/oauth/revoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'token=<string>'const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({token: '<string>'})
};
fetch('https://api.swapnice.com/oauth/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/oauth/revoke"
payload = { "token": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text){
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Invalidate an access or refresh token.
Do not send a Bearer header. Body is
{ "token": "..." }.Authorizations
OAuth 2.1 authorization code with PKCE. Implicit and password flows are unsupported.
Body
application/x-www-form-urlencoded
Response
Token was revoked or was already inactive.
⌘I