Polyv Help Center

Help Center

Query Remaining Resources for Sub-Accounts

Updated: 2022-11-25 09:24:58

API Description

1、集团账号查询分账号剩余资源
2、接口支持https协议

API URL

http://api.polyv.net/live/v4/group/user/package-validity/list

Request Method

GET

API Constraints

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

  2. For group account APIs, use the appId and appSecret of the primary group account for signature calculation.

  3. Expired resources will not be returned in the records.

Request Parameter Description

Parameter Required Type Description
appId true String Primary group account appId
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 for generating the signature is critical for communication data security. It must never 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
emails false String Sub-account emails, separated by commas for multiple entries, max 100
pageSize false Integer Number of items per page, default 10, max 50
pageNumber false Integer Current page number, default 1

Example

http://api.polyv.net/live/v4/group/user/package-validity/list?appId=gc3eo6bh28&timestamp=1660214429000&sign=17A7D2304E85EA18A41C125D65E90DFC

Response Parameter Description

Parameter Type Description
code Integer Status code, same as HTTP status code, used to determine the basic response status
status String Response result, determined by business logic. Returns success on success, error on failure
success Boolean Whether the response was successful
requestId String Request ID, a unique UUID generated for each request. For debugging and troubleshooting only, should not be tied to business logic
error Object Error information when status code is not 200 See Error Field Description
data Object Billing list See Data Field Description

Error Parameter Description

Parameter Type Description
code Integer Error code, used to identify the specific error reason
desc String Error description, corresponding to error.code

Data Parameter Description

Parameter Type Description
pageNumber Integer Current page number
pageSize Integer Number of items per page
totalPages Long Total number of pages
totalItems Long Total number of items
contents Array Content of the current page See Contents Field Description

Contents Parameter Description

Parameter Type Description
userId String User ID
appId String Sub-account application ID
appSecret String Sub-account application secret
email String Sub-account email
balance String Remaining balance
phone String Phone number
memo String Remarks
contacts String Contact person
chargeType String Cloud live streaming billing type
minutes: By minutes
parallelConcurrent: Parallel concurrent
totalConcurrent: Cumulative concurrent
concurrent Array Remaining cloud live streaming concurrent resources See Resource Field Description
minutes Array Remaining cloud live streaming minutes resources See Resource Field Description
flow Array Remaining cloud video on demand traffic (bytes) resources See Resource Field Description
space Array Remaining cloud video on demand storage (bytes) resources See Resource Field Description
expireType String Expiration type
group: Follows the primary account
custom: Custom
expireDate Long Account expiration time, 13-digit timestamp
status String Status
normal: Active
expired: Expired
frozen: Frozen
linkMicMinutes Integer Available link mic minutes
guideMinutes Integer Available cloud director minutes
maxChannels Integer Maximum number of creatable channels
linkMicLimit Integer Number of link mic participants

Resource Parameter Description

Parameter Type Description
start String Start time, format yyyy-MM-dd, e.g., 2022-12-01
end String Expiration time, format yyyy-MM-dd, e.g., 2022-12-10
available Long Available resource quantity
Traffic: bytes
Storage: bytes

Java Request Example

For quick integration of 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. HttpUtil.java and LiveSignUtil.java from 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(ChannelOperateTest.class);
/**
 * 查询分账号剩余资源
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void groupUserPackageListTest() throws IOException, NoSuchAlgorithmException {
    //公共参数,填写自己的实际参数
    String appId = super.groupAppId;
    String appSecret = super.groupAppSecret;
    String timestamp = String.valueOf(System.currentTimeMillis());
    
    //业务参数
    String url = "http://api.polyv.net/live/v4/group/user/package-validity/list";
    
    //http 调用逻辑
    Map<String, String> requestMap = new HashMap<>();
    requestMap.put("appId", appId);
    requestMap.put("timestamp", timestamp);
    requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
    
    String response = HttpUtil.get(url, requestMap);
    
    log.info("测试查询分账号剩余资源成功:{}", response);
    //do somethings
}

Response Example

For system-wide error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "83991d6d866e4dafa2ed81f9946df302.54.16534840806930299",
    "data": {
        "pageNumber": 1,
        "pageSize": 10,
        "totalPages": 1,
        "totalItems": 1,
        "contents": [
            {
                "userId": "*******",
                "appId": "*******",
                "appSecret": "************",
                "email": "*******@polyv.net",
                "balance": "0",
                "phone": "*******",
                "memo": "aaa",
                "chargeType": "minutes",
                "concurrent": [],
                "minutes": [
                    {
                        "start": "2022-11-22",
                        "end": "2022-12-05",
                        "available": 1100
                    },
                    {
                        "start": "2022-12-06",
                        "end": "2022-12-10",
                        "available": 100
                    }
                ],
                "flow": [
                    {
                        "start": "2022-12-15",
                        "end": "2022-12-25",
                        "available": 2147483648
                    }
                ],
                "space": [],
                "expireDate": null,
                "status": "normal",
                "contacts": "测试",
                "expireType": "group",
                "linkMicMinutes": 0,
                "guideMinutes": 0,
                "maxChannels": 0,
                "linkMicLimit": 1,
                "pureRtcEnabled": "Y"
            }
        ]
    },
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "error": {
        "code": 10003,
        "desc": "时间戳过期"
    },
    "success": false
}
联系客服,在线咨询