Skip to content

一起听 - 结束房间

结束一起听房间并停止后续同步。

接口信息

项目
接口地址/listentogether/end
请求方式GET / POST
需要登录
对应模块listentogether_end
文档分类一起听
上游路径/api/listen/together/end/v2

请求参数

参数类型必填默认值说明
roomIdstring-房间 ID

HTTP 示例

bash
POST /listentogether/end?roomId=MzA0NjY5...

编程式调用

ts
import { listentogetherEnd } from 'hana-music-api'

const result = await listentogetherEnd({
  roomId: 'MzA0NjY5...',
})

console.log(result.body)

返回关注点

  • code: 是否调用成功。
  • data.success: 在上游示例页里用于判断房间是否成功关闭。
  • message: 失败时的错误原因。

调用场景

  • 房主结束一起听会话。
  • 前端检测到房间无效后执行清理。
  • 测试脚本在回收临时房间时执行收尾。。

相关接口

Released under the MIT License.