要注册新用户,请向 /api/v1/sign 发送 POST 请求,提供必要的用户信息。
# 注册新用户的示例请求
POST /api/v1/sign HTTP/1.1
Host: https://api.gtstudio.top
Content-Type: application/json
{
"key": "your-api-key",
"account": "new_user",
"Email": "user@example.com",
"password": "user_password",
"Name": "User Name",
"Data": "Additional user data"
}
服务器将会返回以下信息:
{
'message': 'Registration successful'
}
{
'message': 'Account already exists'
}
{
'message': 'Invalid key'
}
<!doctype html>
<html lang=en>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
要登录,请向 /api/v1/login 发送 POST 请求,提供用户凭证。
# 用户登录的示例请求
POST /api/v1/sign HTTP/1.1
Host: https://api.gtstudio.top
Content-Type: application/json
{
"key": "your-api-key",
"account": "new_user",
"password": "user_password",
}
服务器将会返回以下信息:
{
'Name': 'User_Name',
'Uuid':'User_uuid',
'Token':'abcdefghijklmnopqrstyvwxyz12345678',
'Email':'user@example.com',
"Data": "Additional user data"
}
{
'message': 'User not found'
}
{
'message': 'Invalid key'
}
<!doctype html>
<html lang=en>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
要生成随机令牌,请向 /api/v1/generate_token 发送 POST 或 GET 请求。
# 生成随机令牌的示例请求
GET /api/v1/generate_token?length=32 HTTP/1.1
Host: https://api.gtstudio.top
HTTP/1.1 200 OK
Content-Type: application/json
{
"token": "8a4f19a5f043e8ba2607e152ea36d7f6"
}
<!doctype html>
<html lang=en>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
要更新用户账号数据,请向 /api/v1/update_userdata 发送 POST 请求。
# 生成随机令牌的示例请求
POST /api/v1/update_userdata HTTP/1.1
Host: https://api.gtstudio.top
HTTP/1.1 200 OK
Content-Type: application/json
{
"message": "User data update completed"
}
{
'message': 'Invalid key'
}
<!doctype html>
<html lang=en>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>