Polyv Help Center

Help Center

Modify Channel WeChat Share Info (New Version)

Updated: 2025-07-04 13:49:58

Legacy API endpoint Modify Channel WeChat Share Info (Legacy)

API Description

1、修改频道微信分享信息,对应新版后台的 营销-分享设置
2、接口支持https协议

API URL

http://api.polyv.net/live/v4/channel/share/update

Online API Call

Request Method

GET

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details

  2. weixinShareCustomUrl and webShareCustomUrl require URL encoding

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 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 never be 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
shareBtnEnable true String Enable sharing, Y: enable, N: disable
titleType true String Title type: follow live stream title or custom
weixinShareTitle false String Share title, max length 50, Required when titleType is custom
weixinShareDesc false String Share description, max length 120, Required when titleType is custom
weixinShareCustomUrl false String WeChat custom share URL, max length 512, URL must include protocol, e.g., https://,链接需要进行encode
webShareCustomUrl false String Web viewer custom share URL, max length 512, URL must include protocol, e.g., https://,链接需要进行encode
weixinShareCustomUrlWithParamEnabled false String WeChat custom share URL with sharer parameter toggle, Y: enable, N: disable, default N
webShareCustomUrlWithParamEnabled false String Web viewer custom share URL with sharer parameter toggle, Y: enable, N: disable, default N

Example

http://api.polyv.net/live/v4/channel/share/update?shareBtnEnable=Y&titleType=custom&weixinShareDesc=%E4%BF%9D%E5%88%A9%E5%A8%81%E6%B5%8B%E8%AF%95%E5%BE%AE%E4%BF%A1%E5%88%86%E4%BA%AB%E6%8F%8F%E8%BF%B0&appId=frlr1zazn3&weixinShareTitle=%E4%BF%9D%E5%88%A9%E5%A8%81%E6%B5%8B%E8%AF%95%E5%BE%AE%E4%BF%A1%E5%88%86%E4%BA%AB%E6%A0%87%E9%A2%98&sign=F1EB80BAA9D52621CC9D90175BF75B0F&weixinShareCustomUrl=httPs%3A%2F%2Fpolyv.com&channelId=2567762&timestamp=1632818720193

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 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, for troubleshooting and debugging only, 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, corresponds 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 download file.

It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified packaging and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.

    private static final Logger log = LoggerFactory.getLogger(ChannelShareTest.class);

    @Test
    public void testUpdateChannelShare() 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/update";
        
        //http 调用逻辑
        Map<String, String> requestMap = new HashMap<>();
        requestMap.put("appId", appId);
        requestMap.put("timestamp", timestamp);
        requestMap.put("channelId", "2567762");
        requestMap.put("shareBtnEnable", "Y");
        requestMap.put("titleType", "custom");
        requestMap.put("weixinShareTitle", "保利威测试微信分享标题");
        requestMap.put("weixinShareDesc", "保利威测试微信分享描述");
        requestMap.put("weixinShareCustomUrl", "httPs://polyv.com");
        
        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": "0be255f3-51e6-482d-bc27-82cab8b11607",
    "data": null,
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "requestId": "560d3c9c4d2d4736948906cf3769feea.67.16360831361283559",
    "error": {
        "code": 10001,
        "desc": "分享开关不能为空"
    },
    "data": null,
    "success": false
}
联系客服,在线咨询
在线咨询