Polyv Help Center

Help Center

Query User Package and Resource Information

Updated: 2026-07-13 18:29:06

API Description

1、查询当前账号的直播套餐、点播套餐和增值资源信息
2、接口支持https协议

API URL

https://api.polyv.net/live/v4/user/package-resource/get

Online API Call

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. See details

Request Parameter 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 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 and obtain response data. See Signature Generation Rules

Example

https://api.polyv.net/live/v4/user/package-resource/get?appId=frlr1zazn3&timestamp=1720406400000&sign=14A0FA6A31D03D9D1164F55A14E6DB5B

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure
status String Response result, determined by business logic. Returns success on success, error on failure
success Boolean Response result, determined by business logic. Returns true on success, false on failure
data Object Package and resource information 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 for troubleshooting and debugging, should not be tied to business logic

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
resourcePointSettlement String Resource point settlement switch, Y: enabled, N: disabled
balance Number Account balance, in yuan
resourcePointBalance Number Resource point balance
arrearage Number Arrears amount, in yuan
totalCredit Number Total credit limit, in yuan
validCredit Number Available credit balance, in yuan
products Object Product service information See products field description
accretionts Object Value-added service information See accretionts field description

products Parameter Description

Parameter Type Description
cloudLive Object Cloud live streaming package information See cloudLive field description
cloudVod Object Cloud video-on-demand package information See cloudVod field description

cloudLive Parameter Description

Parameter Type Description
name String Package name
startDate String Package start date, format: yyyy-MM-dd
endDate String Package expiration date, format: yyyy-MM-dd
billingPlan String Package billing method, returns duration, concurrent, or live_flow
availableResource Number Available resource value under the current billing method See Live Streaming Resource Description
remainingDays Integer Remaining days of the package
maxChannelCount Integer Maximum number of channels that can be created
availableChannelCount Integer Remaining number of channels that can be created

cloudVod Parameter Description

Parameter Type Description
name String Package name
startDate String Package start date, format: yyyy-MM-dd
endDate String Package expiration date, format: yyyy-MM-dd
validTraffic Number Remaining traffic, in GB
validSpace Number Remaining space, in GB
remainingDays Integer Remaining days of the package

accretionts Parameter Description

Parameter Type Description
items Array Value-added resource list See items field description

items Parameter Description

Parameter Type Description
key String Resource item enumeration value, e.g., GUIDE_PLATE, LINK_MIC, DISTRIBUTE, ASR_ENABLED, AI_ASSISTANT
desc String Resource item Chinese name, e.g., Cloud Studio Switcher, Cloud Live - Co-hosting, Cloud Distribution, Real-time Subtitles (Original Audio), AI Assistant Q&A
enabled String Whether enabled, Y: enabled, N: disabled
value Number Remaining available quantity, unit varies by resource item
unit String Unit of the value field, e.g., minutes, times, characters

Live Streaming Resource Description

cloudLive.availableResource returns the corresponding available resource value based on billingPlan:

billingPlan availableResource Meaning
duration Available live streaming minutes
concurrent Available concurrent resources, number of concurrent connections
live_flow Remaining live streaming traffic (GB)

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. The HttpUtil.java and LiveSignUtil.java in the test cases 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(UserTest.class);
/**
 * 查询用户套餐和资源信息
 * @throws IOException
 * @throws NoSuchAlgorithmException
 */
@Test
public void testGetPackageResource() throws IOException, NoSuchAlgorithmException {
    // 公共参数,填写自己的实际参数
    String appId = super.appId;
    String appSecret = super.appSecret;
    String timestamp = String.valueOf(System.currentTimeMillis());

    // 业务参数
    String url = "https://api.polyv.net/live/v4/user/package-resource/get";

    // 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 global system error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "requestId": "7bd56e99-3705-4bb0-9834-a0201eebcc4a",
    "data": {
        "resourcePointSettlement": "Y",
        "balance": 100.00,
        "resourcePointBalance": 50.00,
        "arrearage": 0.00,
        "totalCredit": 0.00,
        "validCredit": 0.00,
        "products": {
            "cloudLive": {
                "name": "企业直播专业版",
                "startDate": "2026-01-01",
                "endDate": "2026-09-01",
                "billingPlan": "duration",
                "availableResource": 1200,
                "remainingDays": 55,
                "maxChannelCount": 20,
                "availableChannelCount": 12
            },
            "cloudVod": {
                "name": "点播存储套餐",
                "startDate": "2026-01-01",
                "endDate": "2026-09-01",
                "validTraffic": 500.00,
                "validSpace": 300.00,
                "remainingDays": 55
            }
        },
        "accretionts": {
            "items": [
                {
                    "key": "GUIDE_PLATE",
                    "desc": "云导播台",
                    "enabled": "Y",
                    "value": 300
                },
                {
                    "key": "LINK_MIC",
                    "desc": "云直播-连麦",
                    "enabled": "Y",
                    "value": 120
                },
                {
                    "key": "DISTRIBUTE",
                    "desc": "云分发",
                    "enabled": "N",
                    "value": 0
                },
                {
                    "key": "AI_ASSISTANT",
                    "desc": "AI助手答疑",
                    "enabled": "Y",
                    "value": 1000
                }
            ]
        }
    },
    "success": true
}

Error Example

{
    "code": 400,
    "status": "error",
    "requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
    "error": {
        "code": 20001,
        "desc": "application not found."
    },
    "success": false
}
联系客服,在线咨询