Polyv Help Center

Help Center

weixinBookingService

Updated: 2025-09-11 15:18:09

1. Query WeChat Booking Data

Description

查询微信预约数据
接口地址(仅做说明使用):https://api.polyv.net/live/v4/channel/booking/list

Call Constraints

  1. The API call has a frequency limit. For details, please refer to [/live/java/limit.md]. For common call exceptions, please refer to [/live/java/exceptionDoc].

Unit Test

    @Test
    public void testGetBookingStats() throws IOException, NoSuchAlgorithmException {
        LiveGetBookingStatsRequest liveGetBookingStatsRequest = new LiveGetBookingStatsRequest();
        LiveGetBookingStatsResponse liveGetBookingStatsResponse;
        try {
            String channelId = super.getAloneNewChannelId();
            liveGetBookingStatsRequest.setChannelId(channelId);
            liveGetBookingStatsResponse = new ILiveWeixinBookingServiceImpl().getBookingStats(
                    liveGetBookingStatsRequest);
            Assert.assertNotNull(liveGetBookingStatsResponse);
            if (liveGetBookingStatsResponse != null) {
                //to do something ......
                log.debug("测试查询微信预约数据成功 {}", JSON.toJSONString(liveGetBookingStatsResponse));
            }
        } 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. If the request is correct, a LiveGetBookingStatsResponse object is returned, and the B-end processes business logic based on this object.

  2. If the request parameter validation fails, a PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), for example: [ Input parameter [xxx.chat.LivexxxRequest] object validation failed, failed fields [pic cannot be empty / msg cannot be empty] ]

  3. If the server encounters an exception during processing, a PloyvSdkException is thrown. The error message can be found in PloyvSdkException.getMessage(), for example: [ Error returned from Polyv request data, request serial number: 66e7ad29fd04425a84c2b2b562d2025b, error reason: invalid signature. ]

Request Parameter Description

Parameter Required Type Description
channelId true String Channel ID
startTime false Date Booking start time, 13-digit millisecond timestamp
endTime false Date Booking end time, 13-digit millisecond timestamp
currentPage false Integer Page number, default is 1 [Corresponds to the pageNumber field in the API documentation]
pageSize false Integer Number of data items per page, default is 20
appId false String POLYV user APP_ID, required for multi-account calls (i.e., when initMultiAccount() is called for multi-account setup). Obtain it by registering on the Polyv official website: Official website -> Login -> Live (Development Settings)
appSecret false String POLYV user APP_SECRET, required for multi-account calls (i.e., when initMultiAccount() is called for multi-account setup). Obtain it by registering on the Polyv official website: Official website -> Login -> Live (Development Settings)

Return Object Description

Parameter Type Description
contents Array Content of the current page [See BookingStatsList Parameter Description for details]
pageSize Integer Number of data items per page, default is 20
currentPage Integer Current page [Corresponds to the pageNumber field in the API documentation]
totalItems Integer Total number of records
totalPage Integer Total number of pages [Corresponds to the totalPages field in the API documentation]
BookingStatsList Parameter Description
Parameter Type Description
channelId String Channel ID
channelName String Channel name
openId String User ID (WeChat openId)
createdTime Date Booking time, 13-digit millisecond timestamp

联系客服,在线咨询