简要描述:
- 获取直播室或场次礼物赠送记录
请求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
{"datas": [{"pid": "1","giftId": "33d8eed4-a983-4776-b2a3-2d374e5432d5","giftName": "火箭","sessionId": "442afd28-35a9-4d32-9fef-828e66928fc4","unitPoint": 500,"prdPoint": 0,"fromUserId": "71874e9e-b9ea-4144-b275-b9a842b2ac94","toUserId": "f1a9d93e-044f-4300-a26e-33ec74df7c41","quantity": 1,"totalPoint": 0,"createTime": "2017-06-16 16:33:09.0"},{"pid": "2","giftId": "637ce6c0-ae90-448a-8a17-fe264bef0bdd","giftName": "游艇","sessionId": "442afd28-35a9-4d32-9fef-828e66928fc4","unitPoint": 300,"prdPoint": 0,"fromUserId": "71874e9e-b9ea-4144-b275-b9a842b2ac94","toUserId": "f1a9d93e-044f-4300-a26e-33ec74df7c41","quantity": 2,"totalPoint": 600,"createTime": "2017-06-16 16:33:10.0"},{"pid": "3","giftId": "33d8eed4-a983-4776-b2a3-2d374e5432d5","giftName": "火箭","sessionId": "442afd28-35a9-4d32-9fef-828e66928fc4","unitPoint": 500,"prdPoint": 0,"fromUserId": "f1a9d93e-044f-4300-a26e-33ec74df7c41","toUserId": "71874e9e-b9ea-4144-b275-b9a842b2ac94","quantity": 3,"totalPoint": 1500,"createTime": "2017-06-16 16:33:11.0"},{"pid": "4","giftId": "9a165342-3c59-4ca4-b881-f5eb5ea69fac","giftName": "糖果","sessionId": "442afd28-35a9-4d32-9fef-828e66928fc4","unitPoint": 15,"prdPoint": 0,"fromUserId": "d9737a97-6a5d-4e63-840d-98985d1ec373","toUserId": "f1a9d93e-044f-4300-a26e-33ec74df7c41","quantity": 4,"totalPoint": 60,"createTime": "2017-06-16 16:33:13.0"}]}
错误时返回:
状态值: HTTP/1.1 400 Bad Request
{"error": {"key": "global.noprivilege","message": "No privilege."}}
错误代码列表:
格式: 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.