GET
v1.0.0stable

Query Token Expiry

Retrieve the expiry time and validity status of an API token

GET/api/token/expire
Auth:API Key
Limit:120/minute

Request Parameters

All parameters can be passed via Query or Body

ParameterTypeRequiredDescription
token
stringRequired
User API token
Example: your_api_token_here

Response

ParameterTypeRequiredDescription
code
numberRequired
Status code: 1=success, 0=failure
Example: 1
msg
stringRequired
Response message
Example: 查询成功
time
numberRequired
Server timestamp (Unix seconds)
Example: 1769675945
data
objectRequired
Response payload
data.username
stringRequired
Username
Example: testuser
data.expire_time
numberRequired
Expiry timestamp (Unix seconds). 0 means permanent
Example: 1769675945
data.status
stringRequired
Status: permanent, valid, or expired
Example: valid
data.status_text
stringRequired
Status text
Example: 有效
data.is_valid
booleanRequired
Whether the token is valid
Example: true
data.remaining_seconds
numberRequired
Remaining seconds (-1 means permanent)
Example: 2592000
data.remaining_days
numberRequired
Remaining days (-1 means permanent)
Example: 30
data.expire_time_formatted
stringRequired
Formatted expiry time (not returned if permanent)
Example: 2026-02-28 15:04:05
ysucc
stringRequired
Success flag, returns "Ysucc" on success
Example: Ysucc
Response Example
{
"code":1,
"msg":"Query successful",
"time":1769675945,
"data":
{
"username":"testuser",
"expire_time":1772267945,
"status":"valid",
"status_text":"有效",
"is_valid":true,
"remaining_seconds":2592000,
"remaining_days":30,
"expire_time_formatted":"2026-02-28 15:04:05"
}
,
"ysucc":"Ysucc"
}

Permanent Token

Returns permanent when the token has no expiry set

Permanent Token
{
"code":1,
"msg":"Query successful",
"time":1769675945,
"data":
{
"username":"testuser",
"expire_time":0,
"status":"permanent",
"status_text":"永久有效",
"is_valid":true,
"remaining_seconds":-1,
"remaining_days":-1
}
,
"ysucc":"Ysucc"
}

Expired Token

Token has exceeded its expiry time

Expired Token
{
"code":1,
"msg":"Query successful",
"time":1769675945,
"data":
{
"username":"testuser",
"expire_time":1769000000,
"status":"expired",
"status_text":"已过期",
"is_valid":false,
"expired_seconds":675945,
"expired_days":7,
"expire_time_formatted":"2026-01-21 12:26:40"
}
,
"ysucc":"Ysucc"
}

Error Codes

Error Codes3 defined
0
Token is required
Token parameter is missing
0
Invalid token
Invalid token or has been replaced
0
Only GET requests are supported
Used non-GET method

Response Language

Customize the API response language with the X-Lang header. The code examples below automatically use your current site language.

Recommended Header
X-Lang: en
Supported Languages
zh, en, zh-TW, vi, ar

Accept-Language is also supported; X-Lang takes priority. Unsupported languages fall back to English.

Code Examples

curl -X GET "https://testypro.iwai.cc,https://cer.xyul.cn,https://cer.iwai.cc/api/token/expire?token=your_api_token_here" \
  -H "X-Lang: en"

Notes

  • expire_time of 0 means the token is permanent
  • remaining_seconds/remaining_days of -1 means permanent
  • Expired tokens can still query expiry, but is_valid is false
  • Replaced tokens cannot be queried, will return invalid token error

Try it in Console

Fill in the parameters below and send a request to test. Requests only go to this site's API; the URL is locked and cannot be changed, and your current login cookie is included.

GEThttps://testypro.iwai.cc/api/token/expire?token=your_api_token_hereLocked to this site
stringRequired

User API token