Polyv Help Center

Help Center

webInfo

Updated: 2025-10-29 14:26:06

1. Set Channel Name

Description

设置频道名称
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channels/%s/update

Call Constraints

  1. API calls are rate-limited. Click for details. For common call exceptions, click here.

Unit Test

    @Test
    public void testUpdateChannelName() throws Exception, NoSuchAlgorithmException {
        LiveUpdateChannelNameRequest liveUpdateChannelNameRequest = new LiveUpdateChannelNameRequest();
        Boolean liveUpdateChannelNameResponse;
        try {
            liveUpdateChannelNameRequest.setChannelId(createChannel())
                    .setName("Junit测试(勿删)");
            liveUpdateChannelNameResponse = new LiveWebInfoServiceImpl().updateChannelName(
                    liveUpdateChannelNameRequest);
            Assert.assertNotNull(liveUpdateChannelNameResponse);
            if (liveUpdateChannelNameResponse) {
                //to do something ......
                log.debug("测试设置频道名称成功");
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

Unit Test Description

  1. On a successful request, a Boolean object is returned. The B-end processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. If the server encounters an error, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ POLYV request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
name true String Modified channel name
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)

Return Object Description

true indicates success, false indicates failure.




2. Set Host Name

Description

设置主持人姓名
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channelSetting/%s/setPublisher

Call Constraints

  1. API calls are rate-limited. Click for details. For common call exceptions, click here.

Unit Test

    @Test
    public void testUpdateChannelPublisher() throws Exception, NoSuchAlgorithmException {
        LiveUpdateChannelPublisherRequest liveUpdateChannelPublisherRequest = new LiveUpdateChannelPublisherRequest();
        Boolean liveUpdateChannelPublisherResponse;
        try {
            liveUpdateChannelPublisherRequest.setChannelId(createChannel())
                    .setPublisher("主讲老师");
            liveUpdateChannelPublisherResponse = new LiveWebInfoServiceImpl().updateChannelPublisher(
                    liveUpdateChannelPublisherRequest);
            Assert.assertNotNull(liveUpdateChannelPublisherResponse);
            if (liveUpdateChannelPublisherResponse) {
                //to do something ......
                log.debug("测试设置主持人姓名成功");
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

Unit Test Description

  1. On a successful request, a Boolean object is returned. The B-end processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. If the server encounters an error, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ POLYV request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
publisher true String Host name, no more than 20 characters
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)

Return Object Description

true indicates success, false indicates failure.




3. Query Live Splash Screen Status and URL

Description

查询直播引导图开关状态及URL
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channelSetting/%s/getSplash

Call Constraints

  1. API calls are rate-limited. Click for details. For common call exceptions, click here.

Unit Test

    @Test
    public void testGetChannelSplash() throws Exception, NoSuchAlgorithmException {
        LiveChannelSplashRequest liveChannelSplashRequest = new LiveChannelSplashRequest();
        LiveChannelSplashResponse liveChannelSplashResponse;
        try {
            liveChannelSplashRequest.setChannelId(createChannel());
            liveChannelSplashResponse = new LiveWebInfoServiceImpl().getChannelSplash(liveChannelSplashRequest);
            Assert.assertNotNull(liveChannelSplashResponse);
            if (liveChannelSplashResponse != null) {
                //to do something ......
                log.debug("测试查询直播引导图开关状态及URL成功,{}", JSON.toJSONString(liveChannelSplashResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

Unit Test Description

  1. On a successful request, a LiveChannelSplashResponse object is returned. The B-end processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. If the server encounters an error, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ POLYV request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)

Return Object Description

Parameter Type Description
splashImg String Splash image URL
splashEnabled String Splash feature switch, Y/N






4. Set Channel Icon

Description

设置频道图标
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channelSetting/%s/setCoverImg

Call Constraints

  1. API calls are rate-limited. Click for details. For common call exceptions, click here.

Unit Test

    @Test
    public void testUpdateChannelLogo() throws Exception, NoSuchAlgorithmException {
        LiveUpdateChannelLogoRequest liveUpdateChannelLogoRequest = new LiveUpdateChannelLogoRequest();
        String liveUpdateChannelLogoResponse;
        try {
            String path = getClass().getResource("/img/elephant.png").getPath();
            liveUpdateChannelLogoRequest.setChannelId(createChannel())
                    .setImgfile(new File(path));
            liveUpdateChannelLogoResponse = new LiveWebInfoServiceImpl().updateChannelLogo(
                    liveUpdateChannelLogoRequest);
            Assert.assertNotNull(liveUpdateChannelLogoResponse);
            if (liveUpdateChannelLogoResponse != null) {
                //to do something ......
                log.debug("测试设置频道图标成功,{}", liveUpdateChannelLogoResponse);
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

Unit Test Description

  1. On a successful request, a String object is returned. The B-end processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. If the server encounters an error, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ POLYV request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
imgfile true File Image file, JPG, JPEG, or PNG format, max size 2MB
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)

Return Object Description

On success, returns the icon URL, e.g., //livestatic.videocc.net/uploaded/images/2017/03/******.jpg




5. Set Splash Screen Switch and Image

Description

设置引导开关以及引导图片
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channelSetting/%s/setSplash

Call Constraints

  1. API calls are rate-limited. Click for details. For common call exceptions, click here.

Unit Test

    @Test
    public void testUpdateChannelSplash() throws Exception, NoSuchAlgorithmException {
        LiveUpdateChannelSplashRequest liveUpdateChannelSplashRequest = new LiveUpdateChannelSplashRequest();
        String liveUpdateChannelSplashResponse;
        try {
            String path = getClass().getResource("/img/elephant.png").getPath();
            liveUpdateChannelSplashRequest.setChannelId(createChannel())
//                    .setImgfile(new File(path))
                    .setSplashEnabled("Y");
            liveUpdateChannelSplashResponse = new LiveWebInfoServiceImpl().updateChannelSplash(
                    liveUpdateChannelSplashRequest);
            Assert.assertNotNull(liveUpdateChannelSplashResponse);
            if (liveUpdateChannelSplashResponse != null) {
                log.debug("设置引导开关以及引导图片成功,{}", liveUpdateChannelSplashResponse);
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

Unit Test Description

  1. On a successful request, a String object is returned. The B-end processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. If the server encounters an error, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ POLYV request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
splashEnabled true String Enable or disable the splash page, Y or N
imgfile false File Supports JPG, JPEG, PNG formats, max size 4MB
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)

Return Object Description

Setting the splash page without uploading an image returns success on success. Setting the splash page and uploading an image returns the URL on success, e.g., //xxx.videocc.net/uploaded/images/2017/03/******.jpg




6. Query Channel Likes and Viewer Heat

Description

查询频道点赞数和观众热度值
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channels/live-likes

Call Constraints

  1. API calls are rate-limited. Click for details. For common call exceptions, click here.

Unit Test

    @Test
    public void testGetChannelLikes() throws Exception, NoSuchAlgorithmException {
        LiveChannelLikesRequest liveChannelLikesRequest = new LiveChannelLikesRequest();
        LiveChannelLikesResponse liveChannelLikesResponse;
        try {
            liveChannelLikesRequest.setChannelIds("1965681");
            liveChannelLikesResponse = new LiveWebInfoServiceImpl().getChannelLikes(liveChannelLikesRequest);
            Assert.assertNotNull(liveChannelLikesResponse);
            if (liveChannelLikesResponse != null) {
                //to do something ......
                log.debug("测试查询频道点赞数和观众热度值成功,{}", JSON.toJSONString(liveChannelLikesResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

Unit Test Description

  1. On a successful request, a LiveChannelLikesResponse object is returned. The B-end processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. If the server encounters an error, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ POLYV request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelIds true String Comma-separated channel IDs, e.g., 10000,100001. Max 20.
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)

Return Object Description

Parameter Type Description
channelLikes Array Channel likes and viewer heat See ChannelLikes parameter description
ChannelLikes Parameter Description
Parameter Type Description
channelId String Channel ID
likes Integer Number of channel likes
viewers Integer Channel viewer heat






7. Set Channel Live Countdown Information

Description

设置频道直播倒计时信息
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channelSetting/%s/set-countdown

Call Constraints

  1. API calls are rate-limited. Click for details. For common call exceptions, click here.

Unit Test

    @Test
    public void testUpdateChannelCountDown() throws Exception, NoSuchAlgorithmException {
        LiveUpdateChannelCountDownRequest liveUpdateChannelCountDownRequest = new LiveUpdateChannelCountDownRequest();
        Boolean liveUpdateChannelCountDownResponse;
        try {
            liveUpdateChannelCountDownRequest.setChannelId(createChannel())
                    .setBookingEnabled("Y")
                    .setStartTime(getDate(2020, 11, 11, 11, 11, 11));
            liveUpdateChannelCountDownResponse = new LiveWebInfoServiceImpl().updateChannelCountDown(
                    liveUpdateChannelCountDownRequest);
            Assert.assertTrue(liveUpdateChannelCountDownResponse);
            if (liveUpdateChannelCountDownResponse) {
                //to do something ......
                log.debug("测试设置频道直播倒计时信息成功");
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

Unit Test Description

  1. On a successful request, a Boolean object is returned. The B-end processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. If the server encounters an error, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ POLYV request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
bookingEnabled false String Booking watch switch, Y or N
startTime false Date Live start time. If not provided, the live time and countdown are not displayed (yyyy-MM-dd HH:mm:ss)
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)

Return Object Description

true indicates success, false indicates failure.




8. Query Channel Live Countdown Information

Description

查询频道直播倒计时信息
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channelSetting/%s/get-countdown

Call Constraints

  1. API calls are rate-limited. Click for details. For common call exceptions, click here.

Unit Test

    @Test
    public void testGetChannelCountDown() throws Exception, NoSuchAlgorithmException {
        LiveChannelCountDownRequest liveChannelCountDownRequest = new LiveChannelCountDownRequest();
        LiveChannelCountDownResponse liveChannelCountDownResponse;
        try {
            liveChannelCountDownRequest.setChannelId(createChannel());
            liveChannelCountDownResponse = new LiveWebInfoServiceImpl().getChannelCountDown(
                    liveChannelCountDownRequest);
            Assert.assertNotNull(liveChannelCountDownResponse);
            if (liveChannelCountDownResponse != null) {
                //to do something ......
                log.debug("测试查询频道直播倒计时信息成功,{}", JSON.toJSONString(liveChannelCountDownResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }

Unit Test Description

  1. On a successful request, a LiveChannelCountDownResponse object is returned. The B-end processes business logic based on this object.

  2. If request parameter validation fails, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. If the server encounters an error, a PloyvSdkException is thrown. Error details are available via PloyvSdkException.getMessage(), e.g., [ POLYV request returned data error, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
appId false String POLYV user APP_ID. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)
appSecret false String POLYV user APP_SECRET. Required for multi-account calls (i.e., when initMultiAccount() is called). Obtain from the POLYV official website: Website -> Login -> Live (Development Settings)

Return Object Description

Parameter Type Description
bookingEnabled String Booking watch switch, Y or N
startTime Date Live start time. Null if no start time is set.

联系客服,在线咨询