报名观看数据查询

接口URL

https://api.polyv.net/live/v3/channel/enroll/list

接口说明

1、接口用于查询频道报名观看数据
2、接口支持https

支持格式

JSON

请求方式

GET、POST

请求数限制

TRUE

请求参数

参数名必选类型说明

appId

string

从API设置中获取,在直播系统登记的appId

timestamp

long

13位当前毫秒级时间戳

sign

String

签名,为32位大写的MD5值,生成签名的appSecret密钥作为通信数据安全的关键信息,严禁保存在客户端直接使用,所有API都必须通过客户自己服务器中转调用POLYV服务器获取响应数据【详见签名生成规则

channelId

int

频道号

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "list": [
            {
                "viewerId": "1617162437311",
                "mobile": "15814534111",
                "createTime": 1617162473000,
                "hasWatched": "Y",
                "promoteId": "ppp",
                "fields": [
                    {
                        "name": "手机号码",
                        "value": "15814534111"
                    },
                    {
                        "name": "隐私声明",
                        "value": "√"
                    },
                    {
                        "name": "文本1",
                        "value": ""
                    },
                    {
                        "name": "地域",
                        "value": "广东省/广州市/黄埔区"
                    },
                    {
                        "name": "自定义选项",
                        "value": "选项B"
                    },
                    {
                        "name": "邮箱",
                        "value": "luoyuanbin@polyv.net"
                    },
                    {
                        "name": "姓名",
                        "value": "luo"
                    },
                    {
                        "name": "自定义填空题",
                        "value": "tk"
                    }
                ]
            }
        ]
    }
}

响应字段说明

参数名说明

code

状态码,成功为200,签名失败为403,参数错误为400,服务端错误为500

status

成功为success,错误时为error

message

成功为"",错误时为错误描述信息

data

响应数据

data.list.viewerId

用户ID

data.list.mobile

手机号

data.list.createTime

报名时间,时间戳

data.list.hasWatched

是否已观看 Y是、N否

data.list.promoteId

推广渠道ID

data.list.fields

报名信息

data.list.fields.name

报名信息名称

data.list.fields.value

报名信息值

响应失败JSON示例:

参数错误

{
    "code": 400,
    "status": "error",
    "message": "param validate error",
    "data": ""
}

未输入appId

{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}

appId不正确

{
    "code": 400,
    "status": "error",
    "message": "application not found.",
    "data": ""
}

时间戳错误

{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}

签名错误

{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}

非法频道号

{
    "code": 403,
    "status": "error",
    "message": "illegal channel id: %s",
    "data": ""
}

java请求示例

public void testAddRecordTask() {
        String url = "https://api.polyv.net/live/v3/channel/enroll/list";
        // appId和加密串
        String appId = "xxxxxxx";
        String appSecret = "xxxxxxxxxxxxxxxxxx";
		int channelId = 123;
        Map<String, String> params = new HashMap<>();
        params.put("channelId", String.valueOf(channelId));

        // 调用Polyv的工具类方法设置sign
        PolyvTool.setLiveSign(params, appId, appSecret);
        String content = HttpClientUtil.getInstance()
                .sendHttpPost(url, params);
        System.out.println(content);
}

Last updated