撤销令牌
curl --request POST \
--url https://api.renaiss.xyz/v2/auth/wallet/revoke \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"refreshToken": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({refreshToken: '<string>'})
};
fetch('https://api.renaiss.xyz/v2/auth/wallet/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.renaiss.xyz/v2/auth/wallet/revoke"
payload = { "refreshToken": "<string>" }
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"revoked": true
}Malformed JSON in request body{
"error": "Invalid authentication credential",
"code": "API_AUTH_INVALID_CREDENTIAL"
}{
"error": "Credential is not allowed by this policy",
"code": "API_AUTH_CREDENTIAL_NOT_ALLOWED"
}{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server Error钱包访问令牌
撤销钱包令牌
退出钱包会话,并使本次登录签发的所有访问令牌和刷新令牌失效。
POST
/
v2
/
auth
/
wallet
/
revoke
撤销令牌
curl --request POST \
--url https://api.renaiss.xyz/v2/auth/wallet/revoke \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"refreshToken": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({refreshToken: '<string>'})
};
fetch('https://api.renaiss.xyz/v2/auth/wallet/revoke', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.renaiss.xyz/v2/auth/wallet/revoke"
payload = { "refreshToken": "<string>" }
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"revoked": true
}Malformed JSON in request body{
"error": "Invalid authentication credential",
"code": "API_AUTH_INVALID_CREDENTIAL"
}{
"error": "Credential is not allowed by this policy",
"code": "API_AUTH_CREDENTIAL_NOT_ALLOWED"
}{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server Error请求
需要开发者密钥和刷新令牌
响应
错误码
在下表中查找接口返回的 HTTP 状态码和响应原文。有关各接口通用的处理建议,请参阅错误码含义与处理方式。
| HTTP | 错误码 | 文本字段 | 响应文本与处理方式 |
|---|---|---|---|
400 | API_AUTH_INVALID_INPUT | error | Invalid authentication inputRequest body is too large字段缺失、格式错误或请求体超过 12 KiB,请修正后重发。 |
400 | 无错误码 | text/plain | Malformed JSON in request body |
401 | API_AUTH_INVALID_CREDENTIAL | error | Invalid authentication credential密钥无效,或刷新令牌未知、属于其他开发者。请检查令牌,不要使用同一令牌重试。 |
401 | API_AUTH_MISSING_CREDENTIAL | error | Required authentication credential is missing请在 x-builder-api-key 请求头中提供开发者密钥。 |
403 | API_AUTH_CREDENTIAL_NOT_ALLOWED | error | Credential is not allowed by this policy此路由只接受开发者密钥。移除 Authorization 请求头及其他凭据,再重新发送。 |
403 | GACHA_V3_BUILDER_NOT_ACCEPTED_ON_PUBLIC_API | error | This builder checks out on its own surface, not on the public API此密钥无法用于当前 API。请联系 Renaiss,无需重试。 |
429 | API_AUTH_RATE_LIMITED | error | Authentication rate limit exceeded已达到密钥的请求频率上限。稍候再以较低频率重试。 |
500 | API_AUTH_ERROR | error | Internal server error |
500 | FUNCTION_ERROR | error | Internal server error |
500 | 无错误码 | text/plain | Internal Server Error |