简要描述:

  • 获取直播室信息

请求URL:

  • /zhibo/open/rooms

HTTP请求方法:

  • GET

请求头:

NA

URL请求参数:

NA

请求体参数:

NA

返回参数说明:

返回200的成功的响应体:

参数名 类型 说明
datas[].pid String 直播间表主键
datas[].orgId String 机构uuid
datas[].sourceId String 产品线标识(10:金牌团队, 20:机构网校, 30:咖场, 40:商城, 50:企业大学, 90:默认产线)
datas[].roomName String 直播室名称
datas[].roomCode String 直播室code
datas[].description String 直播室描述
datas[].allowAnonym int 是否允许匿名观看(0-不允许,1-允许)
datas[].avatarStream String 视频流id
datas[].shareStream String 共享面板流id
datas[].status int 直播间状态(0-禁用,1-启用)
datas[].type int 直播间类型(1-默认,其它-待定)
datas[].createTime String 创建时间
datas[].sessions[].sessionStartTime String 直播场次开始时间
datas[].sessions[].sessionEndTime String 直播场次结束时间
datas[].sessions[].hostName tring 直播场次主讲人名称
datas[].sessions[].hostAvatarUrl String 直播场次主讲人头像
datas[].sessions[].sessionName String 直播场次名称
datas[].sessions[].sessionDesc String 直播场次简介
datas[].sessions[].pid String 直播场次主键pid
datas[].sessions[].deletedFlag int 直播场次删除标记(0=未删除,1=删除)
paging.limit int 每页记录数
paging.offset int 上一页最后一条记录号, offset必须是limit的倍数, 第一页为0. 当前页码可以通过offset/limit + 1来获得.
paging.pages int 列表总页数
paging.count int 列表总记录数

示例:

请求:
GET https://api-zhibo.yxt.com/v1/zhibo/open/rooms
Content-Type: application/json;charset=UTF-8
appkey: xxxxxxxxxxxxxxxxxxxxx
nonce: xxxx
timestamp: xxxxxxxxxx
signature: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
source: xxxx

请求体:
NA

正确时返回:
状态值: HTTP/1.1 200 OK.
Content-Type: application/json;charset=UTF-8

  1. {
  2. "datas":[
  3. {
  4. "pid":"22a2adf5-e850-4237-ad72-fadd85135b6f",
  5. "orgId":"139db85631924a70b66fc6f8c6a9562a",
  6. "sourceId":90,
  7. "roomName":"测试直播室名称",
  8. "roomCode":"20191029222",
  9. "description":"",
  10. "allowAnonym":1,
  11. "mainStream":"",
  12. "avatarStream":"cc7f142bf41247eb9879c9fc8d03e9f0",
  13. "shareStream":"",
  14. "hostPassword":"123456",
  15. "hostPasswordHash":null,
  16. "assistantPassword":"",
  17. "assistantPasswordHash":null,
  18. "playPassword":"",
  19. "playPasswordHash":null,
  20. "status":1,
  21. "type":1,
  22. "createTime":"2019-10-29 23:18:34.0",
  23. "resolutionLow":1,
  24. "resolutionMiddle":1,
  25. "resolutionHigh":0,
  26. "roomCoverUrl":"",
  27. "withSession":1,
  28. "roomsRelated":null,
  29. "sessions":[
  30. {
  31. "sessionStartTime":"2019-10-29 23:09:00.0",
  32. "sessionEndTime":"2019-11-28 00:00:00.0",
  33. "sessionStartTimeTs":0,
  34. "sessionEndTimeTs":0,
  35. "sessionName":"测试老包推流123",
  36. "hostName":null,
  37. "hostAvatarUrl":null,
  38. "sessionDesc":null,
  39. "basePlayCount":0,
  40. "pid":"5e0b6d6b-db9e-448a-9364-560072635a48",
  41. "deletedFlag":0,
  42. "watchCode":null,
  43. "sessionCode":"13083105762"
  44. }
  45. ],
  46. "ad":null,
  47. "enableCollectInfo":0,
  48. "enableWhitelist":0,
  49. "sessionCode":"",
  50. "attendeeWhitelist":[
  51. ],
  52. "highSpeed":0
  53. }
  54. ],
  55. "paging":{
  56. "limit":1,
  57. "offset":0,
  58. "pages":3,
  59. "count":55
  60. }
  61. }

错误时返回:

状态值: HTTP/1.1 400 Bad Request

  1. {
  2. "error": {
  3. "key": "global.noprivilege",
  4. "message": "No privilege."
  5. }
  6. }

错误代码列表:

格式: key=状态码;message
apis.zhiboadmin.validation.orgId.invalid=400;Invalid orgId.
apis.auth.client.status.invalid=400;Client Org status is invalid.
apis.zhibo.orgadmin.validation.service.expired=400;Service is not active.