Polyv Help Center

Help Center

Get Playback Domain Restriction Settings

Updated: 2022-05-23 19:02:59

Interface URL

https://api.polyv.net/v2/play/{userid}/domain

Interface Description

Get playback domain restrictions

Supported Format

JSON

Request Method

GET

Request Parameters

Parameter Required Type and Range Description
userid yes string User ID, replace {userid} in the URL with the actual userid value
ptime yes long Current time in milliseconds (13 digits), valid for 3 minutes
sign yes String Signature, a 40-character uppercase SHA1 value [see Signature Generation Rules]

Example of Successful JSON Response

{
    "code": 200,
    "status": "success",
    "message": "success",
    "data": {
        "userid": "a2dc4f2517",
        "settingType": 2,
        "enableHost": "a.com,b.com",
        "disableHost": "c.com,d.com"
    }
}

Example of Error JSON Response

签名不正确
{
    "code":400,F
    "status":"error",
    "message":"the sign is not right",
    "data":""
}
时间戳过期
{
    "code":400,
    "status":"error",
    "message":"ptime is too old.",
    "data":""
}

Field Description

Field Type Description
code int Return code
status string Return status
message string Return message
data object Operation result
userid string User ID
settingType int Restriction type, 0: no domain restriction, 1: blacklist, 2: whitelist, 3: combined whitelist and blacklist restriction
disableHost string Domains prohibited from playback (blacklist), multiple domains separated by commas, valid when settingType = 1
enableHost string Domains allowed for playback (whitelist), multiple domains separated by commas, valid when settingType = 2

Java Request Example:

    public void testGetPlayDomainLimitSetting() throws Exception {
        String url = "/v2/play/{userid}/domain";
        Map<String, String> params = new HashMap<>();
        params.put("userid", userid);
        params.put("ptime", String.valueOf(System.currentTimeMillis()));
        params.put("sign", getSign(params, secretkey));
        String response = HttpClientUtil.getInstance().sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
        System.out.println(response);
    }
联系客服,在线咨询