1.1 Token 验证

验证指定访问令牌的有效性。

端点: POST /token/auth

请求头:

Text
Content-Type: application/json

请求体:

JSON
{ "token": "aBcD1234EfGh5678IjKlMnOpQrSt", "key": "SHA256 hash of admin key" }

请求示例:

cURL:

Bash
curl -X POST https://api.ndpreforged.com/token/auth \ -H "Content-Type: application/json" \ -d "{ \"token\": \"aBcD1234EfGh5678IjKlMnOpQrSt\", \"key\": \"8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918\" }"

Python:

Python
import hashlib import requests key_hash = hashlib.sha256("admin".encode()).hexdigest() response = requests.post( "https://api.ndpreforged.com/token/auth", json={ "token": "aBcD1234EfGh5678IjKlMnOpQrSt", "key": key_hash } )

响应示例:

Success (200 OK):

JSON
{ "message": "Passed" }

Error Responses:

Status CodeError MessageDescription
400No data请求体为空
400Missing params缺少必需参数
400Token not foundToken 不存在
401Auth failed认证失败
500Server error服务器内部错误

导航