POST
v1.1.0stable

Update Token Expiry

Update the expiry timestamp of the current API token. Set expire_time to 0 to make it permanent.

POST/api/token/expire
Auth:API Key
Limite:60/minute

Richiesta parametri

Tutti i parametri possono essere passati tramite Query o Body

ParametroTipoObbligoDescrizione
token
stringObbligo
Current API token
Esempio: your_api_token_here
expire_time
numberObbligo
New expiry timestamp in Unix seconds or milliseconds. Use 0 for permanent
Esempio: 1772267945

Risposta

ParametroTipoObbligoDescrizione
code
numberObbligo
Status code: 1=success, 0=failure
Esempio: 1
msg
stringObbligo
Response message
Esempio: 设置已保存
data.username
stringObbligo
Username
Esempio: testuser
data.expire_time
numberObbligo
New expiry timestamp. 0 means permanent
Esempio: 1772267945
data.status
stringObbligo
Status: permanent or valid
Esempio: valid
data.is_valid
booleanObbligo
Whether the token is valid
Esempio: true
data.remaining_seconds
numberObbligo
Remaining seconds, -1 when permanent
Esempio: 2592000
Esempio di risposta
{
"code":1,
"msg":"Settings saved",
"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"
}

Codici di errore

Codici di errore3 definito
0
Token is required
Missing token parameter
0
Expiration time is required
Missing or invalid expire_time
0
Expiration time must be in the future
expire_time is not 0 and is earlier than current time

Lingua di risposta

Personalizza il linguaggio di risposta API con l'intestazione X-Lang. Gli esempi di codice qui sotto utilizzano automaticamente la lingua del tuo sito corrente.

Intestazione consigliata
X-Lang: it
Lingue supportate
zh, en, zh-TW, vi, ar, es, ru

Accetta-Language è anche supportato; X-Lang prende la priorità.

Esempi di codice

curl -X POST "https://testypro.iwai.cc,https://cer.xyul.cn,https://cer.iwai.cc/api/token/expire" \
  -H "X-Lang: it" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "token=your_api_token_here&expire_time=1772267945"

Note

  • 该接口会校验当前 token 是否有效,已过期 token 不能用于修改有效期
  • expire_time 支持秒级或毫秒级时间戳,传 0 可设置为永久有效
  • 修改成功后会清除旧 token 缓存,后续请求立即按新有效期校验

Provalo in Console

Compila i parametri qui sotto e invia una richiesta al test. Le richieste vanno solo all'API di questo sito; l'URL è bloccato e non può essere modificato e il cookie di login corrente è incluso.

POSThttps://testypro.iwai.cc/api/token/expireBloccato a questo sito
stringObbligo

Current API token

numberObbligo

New expiry timestamp in Unix seconds or milliseconds. Use 0 for permanent