Query Channel WeChat Sharing Information (New Version)
Updated: 2025-07-04 13:49:58
The old API endpoint is Query Channel WeChat Sharing Information (Old Version)
API Description
1、查询频道微信分享信息,对应新版后台的 营销-分享设置
2、接口支持https协议
API URL
http://api.polyv.net/live/v4/channel/share/get
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameters Description
| 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 saved or used directly on the client side. 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 |
Example
http://api.polyv.net/live/v4/channel/share/get?appId=frlr1zazn3&sign=AFEFF406F3E243B7F3882B0616685448&channelId=2567762×tamp=1632818971891
Response Parameters 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" |
| success | Boolean | Response result, determined by business logic: success returns true, failure returns false |
| data | Object | Channel sharing information returned on successful response See Data Field Description |
| 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 Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to identify the specific error reason |
| desc | String | Error description, corresponding to error.code |
Data Parameters Description
| Parameter | Type | Description |
|---|---|---|
| shareBtnEnable | String | Whether sharing is enabled: Y for enabled, N for disabled |
| titleType | String | Title type: follow for live stream title, custom for custom title |
| weixinShareTitle | String | Share title, maximum length 50 characters. Effective when titleType is custom |
| weixinShareDesc | String | Share description, maximum length 120 characters. Effective when titleType is custom |
| weixinShareCustomUrl | String | WeChat custom share URL, maximum length 512 characters |
| webShareCustomUrl | String | Web viewing custom share URL, maximum length 512 characters |
| weixinShareCustomUrlWithParamEnabled | String | Whether the WeChat viewing custom URL carries sharer parameters: Y for enabled, N for disabled |
| webShareCustomUrlWithParamEnabled | String | Whether the web viewing custom URL carries sharer parameters: Y for enabled, N for disabled |
Java Request Example
For quick integration of the basic code, please download the relevant dependency source code. Click here to download the source code. After downloading, add it to your own source code project. The test cases HttpUtil.java and LiveSignUtil.java are included in the downloaded 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.
private static final Logger log = LoggerFactory.getLogger(ChannelShareTest.class);
@Test
public void testGetChannelShare() 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/share/get";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("channelId", "2567762");
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url,requestMap);
log.info("测试查询频道分享设置,返回值:{}", response);
}
Response Example
Success Example
{
"code": 200,
"status": "success",
"requestId": "779ef4fc-0690-463f-ae1e-59f4bc792be4",
"data": {
"shareBtnEnable": "Y",
"titleType": "custom",
"weixinShareTitle": "保利威测试微信分享标题",
"weixinShareDesc": "保利威测试微信分享描述",
"weixinShareCustomUrl": "httPs://polyv.com",
"webShareCustomUrl": ""
},
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "4081dbac03e6441e8bdd301d8feee5a2.117.16360830804996119",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
