获取当前用户信息
curl --request GET \
--url https://zero.cat/api/user/self \
--header 'Authorization: Bearer <token>'import requests
url = "https://zero.cat/api/user/self"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://zero.cat/api/user/self', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "",
"data": {
"id": 1,
"username": "alice",
"display_name": "Alice",
"role": 1,
"status": 1,
"email": "alice@example.com",
"group": "default",
"quota": 500000,
"used_quota": 100000,
"request_count": 42,
"aff_code": "abcd",
"aff_count": 0,
"aff_quota": 0,
"aff_history_quota": 0,
"inviter_id": 0,
"has_password": true,
"setting": "{}"
}
}用户信息
获取当前用户信息
需要个人访问令牌,作用域:profile:read(个人资料 → 查看)。
GET
/
api
/
user
/
self
获取当前用户信息
curl --request GET \
--url https://zero.cat/api/user/self \
--header 'Authorization: Bearer <token>'import requests
url = "https://zero.cat/api/user/self"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://zero.cat/api/user/self', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "",
"data": {
"id": 1,
"username": "alice",
"display_name": "Alice",
"role": 1,
"status": 1,
"email": "alice@example.com",
"group": "default",
"quota": 500000,
"used_quota": 100000,
"request_count": 42,
"aff_code": "abcd",
"aff_count": 0,
"aff_quota": 0,
"aff_history_quota": 0,
"inviter_id": 0,
"has_password": true,
"setting": "{}"
}
}
