黑盒语音接口
  1. 房间角色接口
黑盒语音接口
  • 教程
  • 开发者服务协议
  • 使用交流
  • 更新日志
  • 开发计划
  • 资源
    • 请求速率限制
    • Websocket
    • Bot命令
  • WEBSOCKET 连接请求
    • 连接到黑盒语音服务
  • HTTP接口
    • 消息接口
      • 发送消息接口的参数
      • 发送消息接口的返回值
      • 发送图片形式的频道消息
      • 发送Markdown文档
      • 更新指定频道消息
      • 删除指定的频道消息
      • 对某条频道消息增加/取消回应(小表情)
      • 发送卡片消息
      • 给用户发送私聊消息
      • 发送频道图片消息
      • 发送频道消息
      • 发送卡片消息
      • 发送频道消息@全体成员/@在线成员
      • 更新指定的频道消息
      • 删除指定的频道消息
      • 对某条频道消息增加/取消回应(小表情)
      • 给用户发送私聊消息
    • 媒体文件上传
      • 上传媒体文件的参数解析
      • 上传媒体文件
    • 房间角色接口
      • 权限相关说明
      • 接口说明
      • 获取房间角色列表
        GET
      • 创建角色
        POST
      • 更新角色
        POST
      • 删除角色
        POST
      • 对指定用户授予指定权限
        POST
      • 对指定用户剥夺指定权限
        POST
    • 房间表情
      • 房间表情包
      • 获取房间上传的表情包
      • 房间删除表情包
      • 房间更新表情包名称
    • 房间接口
      • 房间相关接口文档
      • 修改房间内昵称
      • 分页获取加入的房间列表
      • 获取房间信息
      • 退出房间
      • 房间踢人
      • 获取房间用户列表
  • 服务端推送事件
    • 事件说明
    • 通用推送字段
    • 机器人命令
      • 用户使用Bot命令
    • 频道消息事件
      • 频道消息事件
    • 房间消息事件
      • 房间消息事件
  1. 房间角色接口

更新角色

开发中
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 
必需
角色icon的url
color_list
array[integer]
渐变色的颜色数组
必需
room_id
string 
房间 ID
必需
permissions
string 
权限值
必需
type
integer 
创建的新角色仅为0
必需
color
integer 
必需
颜色值,在界面展示中用于区分不同角色。
hoist
integer 
必需
是否将该角色成员在右侧和普通成员区分显示,1是区分0是不区分
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"
}
修改于 2024-10-17 10:06:40
上一页
创建角色
下一页
删除角色
Built with