Cancel Push Card
Updated: 2022-09-15 09:50:53
API Description
1、取消推送卡片,对应新版后台的 营销-卡片
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/channel/card-push/cancel-push
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See Get Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid for 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 stored or used directly on the client. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See Signature Generation Rules |
| channelId | true | String | Channel ID |
| cardPushId | true | Long | Card push primary key ID |
Example
http://api.polyv.net/live/v4/channel/card-push/cancel-push?appId=frlr1zazn3&sign=352FE89E0FF2A6E1F74C0ED7C8403C70&channelId=2477096×tamp=1634267834353
Form Parameters:
cardPushId=1283
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure |
| status | String | Response result, determined by business logic. Returns success on success, error on failure |
| success | Boolean | Response result, determined by business logic. Returns true on success, false on failure |
| data | Object | Returns null on successful response |
| error | Object | Error information when status code is non-200 See Error Field Description |
| requestId | String | Request ID, a unique UUID generated for each request. Only used for troubleshooting and debugging, should not be tied to business logic |
Error Parameters
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to identify the specific error cause |
| desc | String | Error description, corresponding to error.code |
Java Request Example
For quick integration of the basic code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source project. The test cases include HttpUtil.java and LiveSignUtil.java, both contained in the download file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
/**
* 取消卡片推送
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void testCancelPushChannelCardPush() throws IOException, NoSuchAlgorithmException {
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/channel/card-push/cancel-push";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", "2477096");
Map<String, String> paramMap = new HashMap<>();
paramMap.put("cardPushId", "1283");
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postFormBody(url, paramMap);
log.info("测试取消推送频道卡片成功,返回值:{}", response);
}
Response Example
Success Example
{
"code": 200,
"status": "success",
"requestId": "847f0716fa76461baf8979aaa4415dc3.66.16342678375823967",
"data": null,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "31a6d48f9b8d43bcad2c0963e526cec3.64.16360829685193527",
"error": {
"code": 10001,
"desc": "cardPushId不能为null"
},
"data": null,
"success": false
}
