查询频道商品列表
接口描述
1、获取频道商品库商品列表
2、支持分页
3、接口支持https协议
接口URL
http://api.polyv.net/live/v3/channel/product/list
请求方式
GET
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
请求参数描述
示例
http://api.polyv.net/live/v3/channel/product/list?size=1&appId=frlr1zazn3&sign=4C526B259BEFD10B90F9B159AE1CB92A&page=1&channelId=1965681×tamp=1621843424385
响应参数描述
pageSize
Integer
每页数据大小
pageNumber
Integer
当前的页数
totalItems
Integer
总的条数
startRow
Integer
当前页第一条记录在总结果集中的位置
firstPage
Boolean
是否为第一页,值为:true/false
lastPage
Boolean
是否为最后一页,值为:true/false
prePageNumber
Integer
上一页编号
nextPageNumber
Integer
下一页编号
limit
Integer
每页数量大小
totalPages
Integer
总页数
endRow
Integer
当前页最后一条记录在总结果集中的位置
offset
Integer
分页起始记录
productId
Integer
商品productId
userId
String
POLYV用户ID,和保利威官网一致,获取路径:官网->登录->直播(开发设置)
channelId
String
频道号
name
String
商品名称
price
Float
商品价格,保留两位小数,如:0.01
cover
String
商品封面链接
link
String
商品通用类型商品链接
status
Integer
商品上下架状态 1:上架状态 2:下架状态
createdTime
Long
创建商品时间,13位毫秒级时间戳
lastModified
Long
更新商品时间,13位毫秒级时间戳
rank
Integer
商品排序号
realPrice
Float
商品实际价格,保留两位小数,如:0.01
type
String
平台标志,默认live,其他无效
linkType
Integer
商品链接类型 10:通用链接 11:多平台链接
pcLink
String
多平台链接,PC端跳转链接
mobileLink
String
多平台链接,移动WEB端跳转链接
wxMiniprogramLink
String
多平台链接,小程序端跳转链接
wxMiniprogramOriginalId
String
多平台链接,小程序端ID
mobileAppLink
String
多平台链接,移动APP端跳转链接
androidLink
String
多平台链接,移动APP-安卓系统原生页面链接
iosLink
String
多平台链接,移动APP-苹果系统原生页面链接
params
String
自定义参数,json对象
showId
Integer
显示id
productType
String
商品类型, normal:普通商品 finance:金融商品
btnShow
String
按钮显示文案
features
String
产品特色,卖点标签,json数组
productDesc
String
产品描述,支持特殊字符
yield
String
产品收益率/价格
originId
String
源id,从平台商品库复制新建的商品有值
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下载文件中。
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 查询频道商品库商品列表
* @throws IOException
*/
@Test
public void testGetChannelProductList() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId=super.appId;
String appSecret=super.appSecret;
String userId = super.userId;
String timestamp=String.valueOf(System.currentTimeMillis());
//业务参数
String channelId = "1965681";
String url = "http://api.polyv.net/live/v3/channel/product/list";
String page = "1";
String size = "1";
//http 调用逻辑
Map<String,String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp",timestamp);
requestMap.put("channelId", channelId);
requestMap.put("page",page);
requestMap.put("size", size);
requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询频道商品库商品列表:{}",response);
//do somethings
}
响应示例
系统全局错误说明详见全局错误说明
成功示例
{
"code": 200,
"status": "success",
"message": "",
"data": {
"pageSize": 1,
"pageNumber": 1,
"totalItems": 53,
"contents": [
{
"productId": 134827,
"userId": "1b448be323",
"channelId": 2272655,
"name": "测试添加金融产品1",
"price": null,
"cover": "",
"link": "http://live.polyv.net",
"status": 1,
"createdTime": 1661390909000,
"lastModified": 1661390909000,
"rank": 55,
"realPrice": 0,
"type": "live",
"linkType": 10,
"pcLink": "",
"mobileLink": "",
"androidLink": null,
"iosLink": null,
"otherLink": null,
"wxMiniprogramLink": "",
"wxMiniprogramOriginalId": "",
"mobileAppLink": "",
"params": "{\"id\": 21, \"color\": \"blue\", \"level\": 1}",
"productType": "finance",
"btnShow": "测试按钮显示",
"features": "[\"tab1\", \"tab2\"]",
"productDesc": "测试产品描述",
"yield": "10.01%",
"showId": 53
}
],
"limit": 1,
"totalPages": 53,
"nextPageNumber": 2,
"endRow": 1,
"startRow": 1,
"firstPage": true,
"lastPage": false,
"prePageNumber": 1,
"offset": 0
}
}
异常示例
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
Last updated
Was this helpful?