更新当前用户信息
curl --request PUT \
--url https://zero.cat/api/user/self \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "Alice"
}
'import requests
url = "https://zero.cat/api/user/self"
payload = { "display_name": "Alice" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({display_name: 'Alice'})
};
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": ""
}用户信息
更新当前用户信息
需要个人访问令牌,作用域:profile:write(个人资料 → 编辑)。
只用于修改显示名称。修改密码需要安全验证,请在控制台操作。
PUT
/
api
/
user
/
self
更新当前用户信息
curl --request PUT \
--url https://zero.cat/api/user/self \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "Alice"
}
'import requests
url = "https://zero.cat/api/user/self"
payload = { "display_name": "Alice" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({display_name: 'Alice'})
};
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": ""
}
