简要描述:

  • 获取直播室或场次礼物赠送记录

请求URL:

  • /zhibo/giftprecent?sessionId={sessionId} 获取直播室某场次礼物赠送记录
  • /zhibo/giftprecent?roomId={roomId} 获取直播室所有礼物赠送记录

HTTP请求方法:

  • GET

请求头:

NA

URL请求参数:

名称 类型 是否必须 描述
sessionId String 场次pid
roomId String 房间pid,roomId和sessionId必须任意提供一个
limit int 每页记录数. 默认值为20.
offset int 上一页最后一条记录号, offset必须是limit的倍数, 第一页为0. 当前页码可以通过offset/limit + 1来获得. 默认值为0.

请求体参数:

NA

返回参数说明:

返回200的成功的响应体:

参数名 类型 说明
datas[].pid String 赠送记录pid
datas[].giftId String 礼物pid
datas[].giftName String 礼物名称
datas[].sessionId String 直播场次id
datas[].unitPoint int 单价积分
datas[].prdPoint int 使用产线积分
datas[].fromUserId String 推流或观看客户端系统版本
datas[].toUserId String 推流或观看客户端版本号
datas[].quantity int 赠送数量
datas[].totalPoint int 总积分(产线可忽略)
datas[].createTime String 赠送发生时间

示例:

请求:
GET https://api-zhibo.yxt.com/v1/zhibo/giftprecent?roomId=c4f0cb31-6b9f-44f0-86fc-00d231e436a5
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": "1",
  5. "giftId": "33d8eed4-a983-4776-b2a3-2d374e5432d5",
  6. "giftName": "火箭",
  7. "sessionId": "442afd28-35a9-4d32-9fef-828e66928fc4",
  8. "unitPoint": 500,
  9. "prdPoint": 0,
  10. "fromUserId": "71874e9e-b9ea-4144-b275-b9a842b2ac94",
  11. "toUserId": "f1a9d93e-044f-4300-a26e-33ec74df7c41",
  12. "quantity": 1,
  13. "totalPoint": 0,
  14. "createTime": "2017-06-16 16:33:09.0"
  15. },
  16. {
  17. "pid": "2",
  18. "giftId": "637ce6c0-ae90-448a-8a17-fe264bef0bdd",
  19. "giftName": "游艇",
  20. "sessionId": "442afd28-35a9-4d32-9fef-828e66928fc4",
  21. "unitPoint": 300,
  22. "prdPoint": 0,
  23. "fromUserId": "71874e9e-b9ea-4144-b275-b9a842b2ac94",
  24. "toUserId": "f1a9d93e-044f-4300-a26e-33ec74df7c41",
  25. "quantity": 2,
  26. "totalPoint": 600,
  27. "createTime": "2017-06-16 16:33:10.0"
  28. },
  29. {
  30. "pid": "3",
  31. "giftId": "33d8eed4-a983-4776-b2a3-2d374e5432d5",
  32. "giftName": "火箭",
  33. "sessionId": "442afd28-35a9-4d32-9fef-828e66928fc4",
  34. "unitPoint": 500,
  35. "prdPoint": 0,
  36. "fromUserId": "f1a9d93e-044f-4300-a26e-33ec74df7c41",
  37. "toUserId": "71874e9e-b9ea-4144-b275-b9a842b2ac94",
  38. "quantity": 3,
  39. "totalPoint": 1500,
  40. "createTime": "2017-06-16 16:33:11.0"
  41. },
  42. {
  43. "pid": "4",
  44. "giftId": "9a165342-3c59-4ca4-b881-f5eb5ea69fac",
  45. "giftName": "糖果",
  46. "sessionId": "442afd28-35a9-4d32-9fef-828e66928fc4",
  47. "unitPoint": 15,
  48. "prdPoint": 0,
  49. "fromUserId": "d9737a97-6a5d-4e63-840d-98985d1ec373",
  50. "toUserId": "f1a9d93e-044f-4300-a26e-33ec74df7c41",
  51. "quantity": 4,
  52. "totalPoint": 60,
  53. "createTime": "2017-06-16 16:33:13.0"
  54. }
  55. ]
  56. }

错误时返回:

状态值: HTTP/1.1 400 Bad Request

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

错误代码列表:

格式: key=状态码;message
apis.auth.client.status.invalid=400;Client Org status is invalid.
apis.zhibo.orgadmin.validation.service.expired=400;Service is not active.
apis.zhibo.room.validation.notExisted=404;Room is not existed.
apis.zhibo.gift.precent.validation.provideRoomIdOrSessionId=400;need provide roomId or sessonId.