POST
v1.1.0stable

Update Token

Generate a new API token and invalidate the old token immediately.

POST/api/token/update
Auth:API Key
Limite:30/minute

Richiesta parametri

Tutti i parametri possono essere passati tramite Query o Body

ParametroTipoObbligoDescrizione
token
stringObbligo
Current API token. It becomes invalid immediately after success
Esempio: your_api_token_here

Risposta

ParametroTipoObbligoDescrizione
code
numberObbligo
Status code: 1=success, 0=failure
Esempio: 1
msg
stringObbligo
Response message
Esempio: 刷新成功
data.username
stringObbligo
Username
Esempio: testuser
data.token
stringObbligo
New API token
Esempio: new_api_token_here
data.expire_time
numberObbligo
Expiry timestamp inherited by the new token. 0 means permanent
Esempio: 1772267945
data.old_token_invalidated
booleanObbligo
Whether the old token has been invalidated
Esempio: true
Esempio di risposta
{
"code":1,
"msg":"Refreshed successfully",
"time":1769675945,
"data":
{
"username":"testuser",
"token":"new_api_token_here",
"expire_time":1772267945,
"old_token_invalidated":true
}
,
"ysucc":"Ysucc"
}

Codici di errore

Codici di errore3 definito
0
Token is required
Missing token parameter
0
Invalid token
Token is invalid, replaced, or the account status is unavailable
0
Token expired
Expired tokens cannot update tokens

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/update" \
  -H "X-Lang: it" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "token=your_api_token_here"

Note

  • 调用成功后,旧 token 会立即失效,后续请求必须使用响应中的新 token
  • 新 token 会继承原 token 的有效期配置
  • 接口成功后会清除旧 token 缓存,避免旧 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/updateBloccato a questo sito
stringObbligo

Current API token. It becomes invalid immediately after success