Reference Platform Product to Channel Product
Updated: 2025-11-14 22:10:10
API Description
1、将平台商品引用到指定频道(支持是否同步平台商品标签)
2、(channelId, timestamp, appId)参与sign签名,并和sign一起通过url传递,请求体参数不参与签名,通过post请求体传递【请设置请求头contentType:application/json】
3、接口支持https协议
API URL
http://api.polyv.net/live/v3/channel/product/reference
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
- When copying,
originIdandstatusmust be provided;withTagsis optional (default false). The copy strategy is fixed to REF, no need to passstrategy.
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details on obtaining keys |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value |
| channelId | true | String | Channel ID |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| originId | true | String | Original ID of the platform product |
| status | true | Integer | Product listing status: 1=Listed, 2=Unlisted |
| withTags | false | Boolean | Whether to sync platform product tags, default false |
Example
http://api.polyv.net/live/v3/channel/product/reference?appId=frlr1zazn3×tamp=1670471250000&channelId=2288633&sign=149397BFD607C518A841DAF8777D6A7E
Request body JSON parameters:
{
"originId": "1986275608147554304",
"status": 1,
"withTags": false
}
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure |
| status | String | Response result, determined by business logic: success returns "success", failure returns "error" |
| message | String | Error or informational message |
| data | Object | Returns the newly added channel product information on success |
Java Request Example
For quick integration of the base code, please download the relevant dependency source code. Click here to download the source code and add it to your project. The test cases include HttpUtil.java and LiveSignUtil.java in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The SDK encapsulates API calls, exception handling, signing, and HTTP thread pool.
private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 复制平台商品到频道
*/
@Test
public void testCopyChannelProduct() throws IOException, NoSuchAlgorithmException {
// 公共参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
// 业务参数
String channelId = "2288633";
String url = "http://api.polyv.net/live/v3/channel/product/reference";
// http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", channelId);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
Map<String, Object> json = new HashMap<>();
json.put("originId", "1986275608147554304");
json.put("status", 1);
json.put("withTags", false);
String response = HttpUtil.postJsonBody(url, JSON.toJSONString(json), null);
log.info("测试复制平台商品到频道:{}", response);
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "",
"data": {
"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%"
}
}
Error Example
{
"code": 400,
"status": "error",
"message": "invalid signature.",
"data": ""
}
