Modify Channel Product Configuration
Updated: 2025-04-10 11:28:24
API Description
1、修改频道商品配置
2、接口支持https协议
API URL
https://api.polyv.net/live/v4/channel/product/push/rule
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended to ensure security. API calls have frequency limits. See details
- Incorrect parameters will result in a 400 error response.
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details for obtaining keys |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid within 3 minutes |
| sign | true | String | Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must not be used directly on the client side. All APIs must obtain response data from the POLYV server through the customer's own server relay. See signature generation rules |
| channelId | true | Integer | Channel ID |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| productExplainEnabled | false | String | Product explanation toggle (Y-Enable, N-Disable) |
| productExplainingAutoPushAndSticky | false | String | Auto push and pin during product explanation toggle (Y-Enable, N-Disable) |
| productListSortType | false | String | Channel product library list sort (ASC-Ascending, DESC-Descending [Default]) |
| productTagSortType | false | String | Product tag sort method (DEFAULT-Default sort, CUSTOM-Custom sort) |
| productPushRule | false | String | Push rule (smallCard-Small card, bigCard-Large card, chooseCard-Select on push) |
| productHotEffectEnabled | false | String | Product hot selling effect toggle |
| normalProductHotEffectTips | false | String | Product hot selling effect tip |
| jobProductHotEffectTips | false | String | Job product hot selling effect tip |
| financeProductHotEffectTips | false | String | Financial product hot selling effect tip |
| outLinkProductRedirectEnabled | false | String | External link purchase, whether to redirect directly (Y-Direct redirect, N-View product details) |
| productTagSortOrderIds | false | Array | List of product associated tag IDs |
Example
http://api.polyv.net/live/v4/channel/product/push/rule?appId=frlr1zazn3×tamp=1665629374000&sign=6CFA3141718E1AF0155889EEA2988206&channelId=2974342
Request body JSON parameters:
{
"productExplainEnabled": "N",
"productExplainingAutoPushAndSticky":"N",
"productListSortType":"ASC",
"productTagSortType":"DEFAULT",
"productPushRule": "smallCard",
"productHotEffectEnabled": "Y",
"normalProductHotEffectTips": "热卖中",
"jobProductHotEffectTips": "投送中",
"financeProductHotEffectTips": "选购中",
"outLinkProductRedirectEnabled": "Y",
"productTagSortOrderIds": [1,2,3]
}
Response Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Status code, same as HTTP status code, used to determine basic response status |
| status | String | Response result, determined by business logic. Returns success on success, error on failure |
| success | Boolean | Whether the request was successful |
| requestId | String | Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, not related to business logic |
| error | Object | Error information when status code is not 200 See Error field description |
Error Response Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to determine the specific error cause |
| desc | String | Error description, corresponding to error.code |
Java Request Example
For quick integration of basic code, please download the relevant dependency source code. Click here to download source code. After downloading, add it to your own source code project. HttpUtil.java and LiveSignUtil.java in the test cases are included in the downloaded file.
It is strongly recommended to use the Live Java SDK to implement API functionality. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
* 查询频道商品设置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testUpdateProductSetting() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String userId = super.userId;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "https://api.polyv.net/live/v4/channel/product/push/rule";
String channelId = "2779045";
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));
String jsonStr = "{\"productPushRule\":\"smallCard\",\"productHotEffectEnabled\":\"Y\",\"normalProductHotEffectTips\":\"热卖中\"," +
"\"jobProductHotEffectTips\":\"投送中\",\"financeProductHotEffectTips\":\"选购中\"}";
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, jsonStr, null);
log.info("测试修改频道商品配置,返回值:{}", response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "9bedc2b44dcc4fdb8db8352905a17993.74.17270604170410039",
"data": null,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
