更新角色
开发中
POST
https://chat.xiaoheihe.cn/chatroom/v2/room_role/update
请求参数
Authorization
在 header 添加参数
token
示例:
token: ********************
Query 参数
client_type
string
声明请求黑盒语音
默认值:
heybox_chat
x_client_type
string
声明客户端类型
默认值:
web
os_type
string
声明客户端类型
默认值:
web
x_os_type
string
声明客户端是bot
默认值:
bot
x_app
string
声明请求黑盒语音
默认值:
heybox_chat
chat_os_type
string
声明客户端是bot
默认值:
bot
chat_version
string
必需
默认值:
1.30.0
Header 参数
Content-Type
string
必需
示例值:
application/json;charset=UTF-8
Body 参数application/json
id
string
角色id
name
string
角色名称。
icon
string
必需
color_list
array[integer]
渐变色的颜色数组
room_id
string
房间 ID
permissions
string
权限值
type
integer
创建的新角色仅为0
color
integer
必需
hoist
integer
必需
nonce
string
必需
position
integer
角色位置排序
示例
{
"color": 15158588,
"icon": "https://imgheybox.max-c.com/dev/avatar/2024/10/14/2597c1318c14b26c45732d6177ffc2b6.jpeg",
"name": "测试管理员",
"type": 0,
"hoist": 1,
"permissions": "1",
"heybox_ids": [],
"room_id": "3690041195409809408",
"department_id": "3690041195409809408",
"nonce": "undefined",
"id": "3690041195495620610",
"position": 324567
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://chat.xiaoheihe.cn/chatroom/v2/room_role/update?client_type=&x_client_type=&os_type=&x_os_type=&x_app=&chat_os_type=&chat_version=' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'token;' \
--data-raw '{
"color": 15158588,
"icon": "https://imgheybox.max-c.com/dev/avatar/2024/10/14/2597c1318c14b26c45732d6177ffc2b6.jpeg",
"name": "测试管理员",
"type": 0,
"hoist": 1,
"permissions": "1",
"heybox_ids": [],
"room_id": "3690041195409809408",
"department_id": "3690041195409809408",
"nonce": "undefined",
"id": "3690041195495620610",
"position": 324567
}'
返回响应
🟢200成功
application/json
Body
msg
string
必需
result
object
必需
role
object (角色详情)
角色详情
status
string
必需
示例
{
"msg": "",
"result": {
"role": {
"name": "新权限组",
"icon": "https://imgheybox.max-c.com/dev/avatar/2024/10/09/c94d349733b7c66a75f5f1f4d9ea0857.jpeg",
"color_list": [
6238893,
9714234
],
"id": "3687695177638674432",
"department_id": "3230476736336502784",
"room_id": "3230476736336502784",
"permissions": "2",
"type": 0,
"color": 0,
"position": 266,
"del_tag": 1,
"hoist": 1,
"mentionable": 0,
"creator": "8829926",
"create_time": 1728442496
}
},
"status": "ok"
}