通过签到ID获取签到记录

接口URL

https://api.polyv.net/live/v3/channel/chat/get-checkins

接口说明

通过签到ID获取该次签到记录

支持格式

JSON

请求方式

GET

请求参数

参数名 必选 类型及范围 说明
sign true string 签名
appId true string 开发者账号下的appId
timestamp true string 13位当前时间的时间搓
channelId true int32 频道号
checkinId true string 签到ID

返回错误结果JSON示例

签名错误:
{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
非法频道号:
{
    "code": 403,
    "status": "error",
    "message": "illegal channel id: 372228",
    "data": ""
}

返回正确结果JSON示例

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": [
        {
            "checkinid": "e45f4d20-f5fe-11e9-bb7b-0fb636",
            "nickname": "广州观众/86958",
            "checked": "Y",
            "indate": "2019-10-24",
            "id": 523520,
            "sessionId": "fh6o6k46kx",
            "time": 1571881076840,
            "userid": "1571881038428",
            "roomid": "372228"
        }
    ]
}

返回结果data表示成功修改的数量.

字段说明

字段 说明
code 返回码
status 返回状态
message 返回信息
data 操作结果

数据对象字段说明

字段 类型及范围 说明
checkinid string 签到时间
nickname string 签到学员名称
checked string 签到Y,未签到N
indate string 签到日期
id int32 签到记录主键
sessionId string 场次号
time long 签到时间
userid string 签到学员ID
roomid string 房间号

PHP请求示例

<?php

//引用config.php
include 'config.php';

//接口需要的参数(非sign)赋值
$appId = "XXXXXXXX";
$channelId = "127075";
$checkinId = "xxxxxx";
$timestamp = "123123123123";
$params = array(
        'appId'=>$appId,
        'checkinId'=>$checkinId,
        'channelId'=>$channelId,
        'timestamp'=>$timestamp
    );
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法

$url="https://api.polyv.net/live/v3/channel/chat/get-checkin?appId=$appId&channelId=$channelId&checkinId=$checkinId&sign=$sign&timestamp=$timestamp";

$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;

?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

通过直播场次sessionId获取签到场次记录

接口URL

https://api.polyv.net/live/v3/channel/chat/checkin-by-sessionId

接口说明

通过直播场次sessionId获取直播发起签到记录

支持格式

JSON

请求方式

GET

请求参数

参数名 必选 类型及范围 说明
sign true string 签名
appId true string 开发者账号下的appId
timestamp true string 13位当前时间的时间戳
channelId true int32 频道号
sessionId true string 场次号

返回错误结果JSON示例

签名错误:
{
    "code": 403,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
时间戳错误:
{
    "code": 400,
    "status": "error",
    "message": "invalid timestamp.",
    "data": ""
}

返回正确结果JSON示例

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": [
        {
            "createtime": "2019-10-24 09:37:51",
            "checkinid": "e45f4d20-f5fe-11e9-bb7b-0fb636",
            "sessionId": "fh6o6k46kx",
            "roomid": "372228"
        },
        {
            "createtime": "2019-10-24 09:46:41",
            "checkinid": "204cae80-f600-11e9-bb7b-0fb636",
            "sessionId": "fh6o6k46kx",
            "roomid": "372228"
        }
    ]
}

返回结果data表示成功修改的数量.

字段说明

字段 类型及范围 说明
code int32 返回码
status string 返回状态
message string 返回信息
data string 操作结果

数据对象字段说明

字段 类型及范围 说明
createtime string 签到时间
checkinid string 签到ID
sessionId string 场次号
roomid string 房间号

PHP请求示例

<?php

//引用config.php
include 'config.php';

//接口需要的参数(非sign)赋值
$userId = "XXXXXXXX";
$channelId = "127075";
$sessionId = "xxxxxx";
$timestamp = "123123123123";
$params = array(
        'appId'=>$appId,
        'sessionId'=>$sessionId,
        'channelId'=>$channelId,
        'timestamp'=>$timestamp
    );
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法

$url="https://api.polyv.net/live/v3/channel/chat/checkin-by-sessionId?appId=$appId&channelId=$channelId&sessionId=$sessionId&sign=$sign&timestamp=$timestamp";

$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;

?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

分页获取问卷结果

接口URL

https://api.polyv.net/live/v3/channel/questionnaire/list-answer-records

接口说明

1、接口用于分页查询直播问卷的答题结果及统计
2、接口支持https

返回格式

JSON

请求方式

GET

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 当前13位毫秒级时间戳,3分钟内有效
sign string 签名,为32位大写的MD5值
channelId int 频道号
page int 页号,默认为1
pageSize int 每页大小,默认为10
startDate string 开始时间,格式:2018-12-10
endDate string 结束时间,格式:2018-12-10

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "pageNumber": 1,
        "totalItems": 3,
        "contents": [
            {
                "questionnaireId": "f7g2gtgtsd",
                "customQuestionnaireId": "xxxd33333",
                "questionnaireTitle": "ttt",
                "lastModified": 1544147881000,
                "endTime": 1544147981000,
                "questionStats": {
                    "questions": [
                        {
                            "questionId": "f7g2gtgtt9",
                            "score": 10,
                            "totalScore": 10,
                            "total": 2,
                            "correctCount": 1,
                            "d": 0,
                            "e": 0,
                            "f": 0,
                            "h": 0,
                            "i": 0,
                            "j": 0,
                            "c": 0,
                            "a": 1,
                            "b": 1,
                            "g": 0
                        },
                        {
                            "questionId": "f7g2gtgtyg",
                            "score": 10,
                            "totalScore": 10,
                            "total": 2,
                            "correctCount": 1,
                            "d": 0,
                            "e": 0,
                            "f": 0,
                            "h": 0,
                            "i": 0,
                            "j": 0,
                            "c": 0,
                            "a": 1,
                            "b": 1,
                            "g": 0
                        }
                    ],
                    "total": 2
                },
                "users": [
                    {
                        "viewerId": "1544406042082",
                        "nickname": "广州观众/98347",
                        "totalScore": 20,
                        "answers": [
                            {
                                "questionId": "f7g2gtgtt9",
                                "questionName": "a",
                                "answer": "A",
                                "score": 10,
                                "type": "R"
                            },
                            {
                                "questionId": "f7g2gtgtyg",
                                "questionName": "b",
                                "answer": "A",
                                "score": 10,
                                "type": "R"
                            }
                        ]
                    },
                    {
                        "viewerId": "oL0En04rCbHNSNdey_rFMAkLT-Ps",
                        "nickname": "ilyq69",
                        "submitTime": 1564384274000,
                        "totalScore": 0,
                        "answers": [
                            {
                                "questionId": "f7g2gtgtt9",
                                "questionName": "a",
                                "answer": "B",
                                "score": 0,
                                "type": "R"
                            },
                            {
                                "questionId": "f7g2gtgtyg",
                                "questionName": "b",
                                "answer": "B",
                                "score": 0,
                                "type": "R"
                            }
                        ]
                    }
                ]
            }
        ],
        "endRow": 3,
        "startRow": 1,
        "firstPage": true,
        "lastPage": true,
        "nextPageNumber": 1,
        "prePageNumber": 1,
        "totalPages": 1,
        "limit": 3,
        "offset": 0
    }
}

响应失败JSON示例:

未输入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": 400, 
  "status": "error", 
  "message": "param is not digit: dsadasd", 
  "data": ""
}

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为401,异常错误500(http状态码也跟code相同)
status 成功为success,失败为error
message 错误时为错误提示消息
data 成功时,返回用户答题结果及各个题目的统计信息的分页信息
pageNumber 当前页数
totalItems 总条数
firstPage 是否为第一页,值为:true/false
lastPage 是否为最后一页,值为:true/false
nextPageNumber 下一页编号
prePageNumber 上一页编号
totalPages 总页数
limit 当前页数据条数
contents 频道的问卷信息和统计结果,是数组格式
questionnaireId 问卷ID,string
customQuestionnaireId 用户自定义问卷ID,string
questionnaireTitle 问卷名称,string
lastModified 问卷最后修改时间,13位毫秒级时间戳
endTime 问卷结束答题时间,13位毫秒级时间戳
questionStats 问卷下各个问题的答题统计
questionStats.total 题目的答题人数,int
questionStats.questions 题目的答题统计信息,数组[]
questionStats.questions[].questionId 题目ID,string
questionStats.questions[].questionName 题目名称,string
questionStats.questions[].score 题目分数,int
questionStats.questions[].totalScore 题目的总得分,int
questionStats.questions[].correctCount 题目的答对人数,int
questionStats.questions[].a-g 选择项a到g分别的答题人数,int
users 观看端提交答题的信息
users[].viewerId 提交问卷的用户ID,string
users[].nickname 提交问卷的用户昵称,string
users[].submitTime 提交问卷的用户答题时间,13位毫秒级时间戳
users[].totalScore 提交问卷的用户的总得分,int
users[].answers[] 用户每道题目的答题情况,数组 []
users[].answers[].questionId 题目ID,string
users[].answers[].questionName 题目名称,string
users[].answers[].answer 提交的题目答案,string
users[].answers[].score 用户答题的得分,string
users[].answers[].type 题目的类型,string,R 单选题 ,C 多项题 ,Q 问答题

php请求示例

<?php
//引用config.php
include 'config.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => 195770,
  'startDate' => '2018-12-08',
  'endDate' => '2018-12-10'  
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "http://api.polyv.net/live/v3/channel/questionnaire/list-answer-records?".http_build_query($params);

$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

获取问卷详情

接口URL

https://api.polyv.net/live/v3/channel/questionnaire/detail

接口说明

1、接口用于获取问卷详情
2、问卷ID 可以从获取频道问卷列表中获取
3、接口支持https

返回结果格式

JSON

请求方式

GET

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 当前13位毫秒级时间戳,3分钟内有效
sign string 签名,为32位大写的MD5值
channelId int 频道号
questionnaireId string 问卷id

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "questionnaireId": "fefg598lfj",
        "customQuestionnaireId": "ddddxxx222",
        "channelId": 108888,
        "userId": "edvf2fpec9",
        "name": "测试问卷_1564105496583",
        "status": "forbidden",
        "createdTime": 1564105498000,
        "lastModified": 1564105498000,
        "endTime": 1564105580000,
        "questions": [
            {
                "questionId": "3839e04e78",
                "channelId": 108888,
                "userId": "edvf2fpec9",
                "name": "您觉得课程怎么样",
                "type": "C",
                "option1": "好",
                "option2": "很好",
                "option3": "非常好",
                "option4": "超级好",
                "option5": "以上都对",
                "createdTime": 1564105498000,
                "lastModified": 1564105498000,
                "answer": "",
                "note": null,
                "templateId": null,
                "status": "draft",
                "times": 0,
                "tips1": null,
                "tips2": null,
                "tips3": null,
                "tips4": null,
                "tips5": null,
                "required": "Y",
                "scoreEnabled": "N",
                "option6": "",
                "option7": "",
                "option8": "",
                "option9": "",
                "option10": "",
                "score": null,
                "itemType": 0
            },
            {
                "questionId": "847cd79c2f",
                "channelId": 108888,
                "userId": "edvf2fpec9",
                "name": "您从哪里获取该课程",
                "type": "C",
                "option1": "自己找到",
                "option2": "好友推荐",
                "option3": "媒体文章",
                "option4": "",
                "option5": "",
                "createdTime": 1564105498000,
                "lastModified": 1564105498000,
                "answer": "",
                "note": null,
                "templateId": null,
                "status": "draft",
                "times": 0,
                "tips1": null,
                "tips2": null,
                "tips3": null,
                "tips4": null,
                "tips5": null,
                "required": "Y",
                "scoreEnabled": "N",
                "option6": "",
                "option7": "",
                "option8": "",
                "option9": "",
                "option10": "",
                "score": null,
                "itemType": 0
            },
            {
                "questionId": "c908c81e80",
                "channelId": 108888,
                "userId": "edvf2fpec9",
                "name": "今后还会不会来",
                "type": "R",
                "option1": "会",
                "option2": "不会",
                "option3": "",
                "option4": "",
                "option5": "",
                "createdTime": 1564105498000,
                "lastModified": 1564105498000,
                "answer": "",
                "note": null,
                "templateId": null,
                "status": "draft",
                "times": 0,
                "tips1": null,
                "tips2": null,
                "tips3": null,
                "tips4": null,
                "tips5": null,
                "required": "Y",
                "scoreEnabled": "N",
                "option6": "",
                "option7": "",
                "option8": "",
                "option9": "",
                "option10": "",
                "score": null,
                "itemType": 0
            },
            {
                "questionId": "6dba1e90da",
                "channelId": 108888,
                "userId": "edvf2fpec9",
                "name": "请问您对课程有不满意的地方吗",
                "type": "Q",
                "option1": "",
                "option2": "",
                "option3": "",
                "option4": "",
                "option5": "",
                "createdTime": 1564105498000,
                "lastModified": 1564105498000,
                "answer": "",
                "note": null,
                "templateId": null,
                "status": "draft",
                "times": 0,
                "tips1": null,
                "tips2": null,
                "tips3": null,
                "tips4": null,
                "tips5": null,
                "required": "Y",
                "scoreEnabled": "N",
                "option6": "",
                "option7": "",
                "option8": "",
                "option9": "",
                "option10": "",
                "score": null,
                "itemType": 0
            }
        ]
    }
}

响应失败JSON示例:

未输入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": ""
}

问卷ID不存在

{
    "code": 400,
    "data": "",
    "message": "questionnaire is not exist",
    "status": "error"
}

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为403,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
questionnaireId 问卷ID
customQuestionnaireId 用户自定义问卷ID
channelId 频道ID
userId 用户ID
name 问卷名称
status 问卷状态
createdTime 问卷创建时间
endTime 停止问卷时间
questions 问卷问题列表

问卷问题模型类question

参数名 说明
questionId 问题ID
name 问题题目
type 问题类型,取值:R 单选;C 多选;S 评星题;Q 问答
option1~10 选项A~G 的内容
createdTime 创建时间
lastModified 最后修改时间
scoreEnabled 是否计分,取值Y、N
score 题目分值
required 是否必填,取值Y、N
answer 问题答案

php请求示例

<?php
//引用config.php
include 'config.php';

$params = array(
    'appId' => $appId,
    'timestamp' => $timestamp,
    'channelId' => 108888,
    'questionnaireId' =>'xxxaaa'
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/live/v3/channel/questionnaire/detail?".http_build_query($params);

$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_URL, $url);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

获取频道问卷列表

接口URL

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

接口说明

1、接口用于获取频道的问卷列表
2、接口支持https

支持格式

JSON

请求方式

GET

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 当前13位毫秒级时间戳,3分钟内有效
sign string 签名,为32位大写的MD5值
channelId string 频道号
startTime long 查询的记录的开始时间,13位位毫秒级时间戳
endTime long 查询的记录的结束时间,13位毫秒级时间戳
page int 页号,默认为1
pageSize int 每页条数,默认为10

注意:要按时间区间查询时,startTime 和 endTime 必须同时传参才能生效

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "pageSize": 10,
        "pageNumber": 1,
        "totalItems": 2,
        "contents": [
            {
                "questionnaireId": "fefg598lfj",
                "channelId": 108888,
                "userId": "edvf2fpec9",
                "name": "测试问卷_1564105496583",
                "status": "forbidden",
                "createdTime": 1564105498000,
                "lastModified": 1564105498000,
                "endTime": 1564105580000,
                "customQuestionnaireId": "xxxxxx"
            },
            {
                "questionnaireId": "fefg4s724k",
                "channelId": 108888,
                "userId": "edvf2fpec9",
                "name": "测试问卷",
                "status": "forbidden",
                "createdTime": 1564105469000,
                "lastModified": 1564105469000,
                "endTime": 1564105487000,
                "customQuestionnaireId": "xxxxxx"
            }
        ],
        "startRow": 1,
        "firstPage": true,
        "lastPage": true,
        "nextPageNumber": 1,
        "prePageNumber": 1,
        "limit": 2,
        "endRow": 2,
        "totalPages": 1,
        "offset": 0
    }
}

响应失败JSON示例:

未输入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 响应的状态码,例如:200
status 响应状态
message 异常错误信息
data 响应结果集
pageNumber 当前的页数
totalItems 总的条数
contents 查询的结果列表
questionnaireId 问卷ID
channelId 频道ID
userId 用户ID
name 问卷名称
status 问卷状态,取值:saved(已保存),published (已发布),forbidden (问卷已完成填写)
createdTime 问卷创建时间
lastModified 问卷最后修改时间
endTime 停止提交问卷时间
customQuestionnaireId 用户自定义问卷ID
firstPage 是否为第一页,值为:true/false
lastPage 是否为最后一页,值为:true/false
nextPageNumber 下一页编号
prePageNumber 上一页编号
totalPages 总页数
startRow 当前页第一个视频在回放视频中的位置
endRow 当前页最后一个视频在回放视频中的位置
limit 当前页视频个数

php请求示例

<?php
//引用config.php
include 'config.php';
$params = array(
    'appId' => $appId,
    'timestamp' => $timestamp,
    'channelId' => 108888
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/live/v3/channel/questionnaire/list?".http_build_query($params);

$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_URL, $url);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

打赏-发送打赏消息

接口URL

http://api.polyv.net/live/v3/channel/chat/send-reward-msg

接口说明

  1. 用于发送打赏消息
  2. 请求成功后,服务器会向聊天室的用户广播打赏消息,详见直播聊天室API接口
  3. 接口支持https

支持格式

JSON

请求方式

POST

请求参数

参数名 必选 类型 说明
channelId int 频道ID
appId string 账号的应用ID,在后台的“开发设置”获取
timestamp long 13位毫秒级时间戳
sign string 签名,为32位大写的MD5值
nickname string 打赏者昵称
avatar string 打赏者头像
viewerId string 打赏者ID
donateType string 打赏类型,取值:cash 现金打赏,good 道具打赏
content string 打赏内容:礼物打赏为礼物名称,现金打赏为金额
goodImage string 礼物打赏时为礼物图片,现金打赏时为空
sessionId string 直播场次ID

响应成功JSON示例:

{
    "code": 200, 
    "status": "success", 
    "message": "", 
    "data": 0
}

响应失败JSON示例:

未输入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": 400,
  "status": "error",
  "message": "param is not digit: 输入的错误频道号",
  "data": ""
}

道具打赏时未提交道具图片

{
  "code": 400,
  "status": "error",
  "message": "param should not be empty:goodImage",
  "data": ""
}

发送失败

{
    "code": 400,
    "status": "error",
    "message": "send message failure",
    "data": ""
}

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为403,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 暂无作用

请求示例

<?php
//引用config.php
include 'config.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => "108888",
  'nickname' => "wenen",
  'avatar' => "https://livestatic.videocc.net/uploaded/images/webapp/avatar/default-teacher.png",
  'viewerId' => "123",
  'donateType' => "good",
  'content' => "黄钻",
  'goodImage' => "http://livestatic.videocc.net/uploaded/images/webapp/channel/donate/06-star.png"
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法


$url="http://api.polyv.net/live/v3/channel/chat/send-reward-msg";

function post($url, $post_data = '', $timeout = 5){
   $ch = curl_init();
   curl_setopt ($ch, CURLOPT_URL, $url);
   curl_setopt ($ch, CURLOPT_POST, 1);
   if($post_data != ''){
      curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
   }

   curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
   curl_setopt($ch, CURLOPT_HEADER, false);
   curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
   $file_contents = curl_exec($ch);
   curl_close($ch);
   return $file_contents;
}

$params["sign"] = $sign;
echo post($url,http_build_query($params));
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

抽奖-提交中奖者信息

接口URL

http://api.polyv.net/live/v3/channel/chat/add-receive-info

接口说明

1、用于提交中奖者填写的信息
2、只能成功保存一次观众中奖信息
3、中奖信息需在7天内提交保存,否则会失效
4、接口支持https

支持格式

JSON

请求方式

POST

请求参数

参数名 必选 类型 说明
channelId string 频道ID
appId string 账号的应用ID,在后台的“开发设置”获取
timestamp long 13位毫秒级时间戳
sign string 签名,为32位大写的MD5值
lotteryId string 抽奖场次ID
winnerCode string 中奖码
viewerId string 中奖者ID
name string 中奖者姓名
telephone string 中奖者手机号码

响应成功JSON示例:

{
    "code": 200,
    "status": "success",
    "message": "保存成功",
    "data": ""
}

响应失败JSON示例:

手机号码格式错误

{
    "code": 400,
    "status": "fail",
    "message": "手机号码格式错误",
    "data": ""
}

重复提交(已经成功提交过中奖信息后则不能再次请求)

{
    "code": 400,
    "status": "fail",
    "message": "请勿重复提交",
    "data": ""
}

中奖码不存在

{
    "code": 400,
    "status": "fail",
    "message": "中奖码不存在",
    "data": ""
}

抽奖场次ID错误

{
    "code": 400,
    "status": "fail",
    "message": "illegal lottery id: 错误的ID",
    "data": ""
}

有参数未提交

{
  "code": 400,
  "status": "error",
  "message": "param should not be empty:未提交的参数名",
  "data": ""
}

字段说明

参数名 说明
code 请求状态响应码
status 请求状态
message 错误信息
data 暂无作用

请求示例

<?php
//引用config.php
include 'config.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => "108888",
  'lotteryId' => "f76did5ldj",
  'viewerId' => "viewerId1231",
  'winnerCode' => "12121212123",
  'name' => "wenwenwen",
  'telephone' => "15625123456"
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法


$url="http://api.polyv.net/live/v3/channel/chat/add-receive-info";

function post($url, $post_data = '', $timeout = 5){
   $ch = curl_init();
   curl_setopt ($ch, CURLOPT_URL, $url);
   curl_setopt ($ch, CURLOPT_POST, 1);
   if($post_data != ''){
      curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
   }

   curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
   curl_setopt($ch, CURLOPT_HEADER, false);
   curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
   $file_contents = curl_exec($ch);
   curl_close($ch);
   return $file_contents;
}

$params["sign"] = $sign;
echo post($url,http_build_query($params));
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

问卷设置

接口URL

https://api.polyv.net/live/v3/channel/questionnaire/add-edit-questionnaire

接口说明

1、接口用于编辑或添加问卷信息,为全量增加或修改
2、接口支持https

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 当前13位毫秒级时间戳,3分钟内有效
sign string 签名,为32位大写的MD5值
channelId string 频道号
questionnaireId string 问卷id,修改问卷时需要
customQuestionnaireId string 客户自定义问卷id
questionnaireTitle string 问卷标题
questions array 题目数组
questions[].questionId string 题目id,修改问卷时需要传
questions[].name string 题目
questions[].type string 题目类型,R为单选,C为多选,Q为问答
questions[].scoreEnabled string 题目是否需要评分,Y为需要,N为不需要
questions[].answer string 需要评分的选择题才有答案,填入对应选项序号,如:A或AB
questions[].required string 题目是否为必答,Y为必答,N为非必答
questions[].options array 题目为单选题或多选题为必填,选项数组下标0-9对应答案A-J
questions[].options[] string 选项描述

注:这里的channelId,appId,timestamp,sign必须通过url传参,json数据通过请求体传参,如:
https://api.polyv.net/live/v3/channel/questionnaire/add-edit-questionnaire?channelId={{channelId}}&appId={{appId}}&timestamp={{timestamp}}&sign={{sign}}

请求体json拼接

{
  "questionnaireId": "f8v53d83qe",
  "customQuestionnaireId": "12345667778",
  "questionnaireTitle": "问卷标题", 
  "questions": [
    {
      "questionId": "feqfr13ftz", 
      "name": "题目名称", 
      "type": "R", 
      "answer": "A", 
      "scoreEnabled": "Y", 
      "score": 10, 
      "required": "Y", 
      "options": [
        "选项1", 
        "选项2", 
        "选项3"
      ]
    }
  ]
}

响应成功JSON示例:

{
  "code": 200, 
  "status": "success", 
  "message": "", 
  "data": {
    "questionnaireId": "f8v3visks0", 
    "questionIds": [
      "3ff650e4d4"
    ]
  }
}

响应失败JSON示例:

未输入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": 400, 
  "status": "error", 
  "message": "param is not digit: dsadasd", 
  "data": ""
}

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为401,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 成功响应时为问卷和题目id
data.questionnaireId 问卷id
data.questionIds[] 题目的id数组

Java请求示例

import com.live.util.EncryptionUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Demo {

    private static RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(15000).setConnectTimeout(15000)
            .setConnectionRequestTimeout(15000).build();

    public static void main(String[] args) {

        String url = "https://api.polyv.net/live/v3/channel/questionnaire/add-edit-questionnaire";
        int channelId = 206204;
        String appId = "f018j7iirt";
        String key = "96651acd43e04cc8a94a1cfa60cec909";
        Map<String, String> map = new HashMap<>();
        long timestamp = System.currentTimeMillis();
        map.put("appId", appId);
        map.put("timestamp", String.valueOf(timestamp));
        map.put("channelId", String.valueOf(channelId));

        String sign = getSign(map, key);
        map.put("sign", sign);
        String body = "{\"questionnaireTitle\":\"问卷标题\",\"questions\":[{\"questionId\":null,\"name\":\"题目名称\"," +
                "\"type\":\"R\",\"answer\":\"A\",\"scoreEnabled\":\"Y\",\"score\":10,\"required\":\"Y\"," +
                "\"options\":[\"选项1\",\"选项2\",\"选项3\"]}],\"questionnaireId\":null}";
        String content = sendHttpPost(url, map, body);
        System.out.println(content);

    }

    /**
     * 发送 post请求
     * @param httpUrl 地址
     * @param maps 参数
     */
    public static String sendHttpPost(String httpUrl, Map<String, String> maps, String body) {
        StringBuilder url = new StringBuilder();
        url.append(httpUrl).append("?");
        for (Map.Entry<String, String> map : maps.entrySet()) {
            url.append(map.getKey()).append("=").append(map.getValue()).append("&");
        }
        String urlStr = url.toString().substring(0, url.length() - 1);
        // 创建httpPost
        HttpPost httpPost = new HttpPost(urlStr);
        try {
            StringEntity entity = new StringEntity(body, Charset.forName("UTF-8"));
            httpPost.setEntity(entity);
        } catch (Exception e) {
            // ...
        }
        return sendHttpPost(httpPost);
    }

    /**
     * 发送Post请求
     * @param httpPost
     * @return
     */
    private static String sendHttpPost(HttpPost httpPost) {
        CloseableHttpClient httpClient = null;
        CloseableHttpResponse response = null;
        HttpEntity entity;
        String responseContent = null;
        try {
            // 创建默认的httpClient实例.
            httpClient = HttpClients.createDefault();
            httpPost.setConfig(requestConfig);
            // 执行请求
            response = httpClient.execute(httpPost);
            entity = response.getEntity();
            responseContent = EntityUtils.toString(entity, "UTF-8");
        } catch (Exception e) {
            // ...
        } finally {
            try {
                // 关闭连接,释放资源
                if (response != null) {
                    response.close();
                }
                if (null != httpPost) {
                    httpPost.releaseConnection();
                }
                if (httpClient != null) {
                    httpClient.close();
                }
            } catch (IOException e) {
                // ...
            }
        }
        return responseContent;
    }

    /**
     * 根据map里的参数构建加密串
     * @param map
     * @param secretKey
     * @return
     */
    protected static String getSign(Map<String, String> map, String secretKey) {
        Map<String, String> params = paraFilter(map);
        // 处理参数,计算MD5哈希值
        String concatedStr = concatParams(params);
        String plain = secretKey + concatedStr + secretKey;
        String encrypted = EncryptionUtils.md5Hex(plain);

        // 32位大写MD5值
        return encrypted.toUpperCase();
    }

    /**
     * 对params根据key来排序并且以key1=value1&key2=value2的形式拼接起来
     * @param params
     * @return
     */
    private static String concatParams(Map<String, String> params) {
        List<String> keys = new ArrayList<>(params.keySet());
        Collections.sort(keys);

        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < keys.size(); i++) {
            String key = keys.get(i);
            String value = params.get(key);

            sb.append(key).append(value);
        }

        return sb.toString();
    }

    /**
     * 除去数组中的空值和签名参数
     * @param sArray 签名参数组
     * @return 去掉空值与签名参数后的新签名参数组
     */
    private static Map<String, String> paraFilter(Map<String, String> sArray) {

        Map<String, String> result = new HashMap<>();

        if (sArray == null || sArray.size() <= 0) {
            return result;
        }

        for (String key : sArray.keySet()) {
            String value = sArray.get(key);
            if (value == null || value.equals("") || key.equalsIgnoreCase("sign")
                    || key.equalsIgnoreCase("sign_type")) {
                continue;
            }
            result.put(key, value);
        }

        return result;
    }

}

php请求示例

<?php
//引用config.php
include 'config.php';

$params = array(
    'appId' => $appId,
    'timestamp' => $timestamp,
    'channelId' => 206204
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "https://api.polyv.net/live/v3/channel/questionnaire/add-edit-questionnaire?".http_build_query($params);
$json = '{
  "questionnaireTitle": "问卷标题", 
  "questions": [
    {
      "questionId": null, 
      "name": "题目名称", 
      "type": "R", 
      "answer": "A", 
      "scoreEnabled": "Y", 
      "score": 10, 
      "required": "Y", 
      "options": [
        "选项1", 
        "选项2", 
        "选项3"
      ]
    }
  ], 
  "questionnaireId": null
}';

function post($url, $post_data = '', $timeout = 5){
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_POST, 1);
    if($post_data != ''){
       curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    }

    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($post_data)));
    $file_contents = curl_exec($ch);
    curl_close($ch);
    return $file_contents;
}

echo post($url,$json);
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

问卷结果查询API

接口URL

https://api.polyv.net/live/v3/channel/questionnaire/answer-records

接口说明

1、接口用于查询直播问卷的答题结果及统计
2、接口支持https

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 当前13位毫秒级时间戳,3分钟内有效
sign string 签名,为32位大写的MD5值
channelId int 频道号
startDate string 开始时间,格式:2018-12-10
endDate string 结束时间,格式:2018-12-10

响应成功JSON示例:

{
"code": 200,
"status": "success",
"message": "",
"data": [
{
"questionnaireId": "f7g2gtgtsd",
"customQuestionnaireId":"dkki24kjdj",
"questionnaireTitle": "ttt",
"questionStats": {
"questions": [
{
"questionId": "f7g2gtgtt9",
"score": 10,
"totalScore": 10,
"total": 2,
"correctCount": 1,
"d": 0,
"e": 0,
"f": 0,
"h": 0,
"i": 0,
"j": 0,
"c": 0,
"a": 1,
"b": 1,
"g": 0
},
{
"questionId": "f7g2gtgtyg",
"score": 10,
"totalScore": 10,
"total": 2,
"correctCount": 1,
"d": 0,
"e": 0,
"f": 0,
"h": 0,
"i": 0,
"j": 0,
"c": 0,
"a": 1,
"b": 1,
"g": 0
}
],
"total": 2
},
"users": [
{
"viewerId": "1544406042082",
"nickname": "广州观众/98347",
"totalScore": 20,
"answers": [
{
"questionId": "f7g2gtgtt9",
"questionName": "a",
"answer": "A",
"score": 10,
"type": "R"
},
{
"questionId": "f7g2gtgtyg",
"questionName": "b",
"answer": "A",
"score": 10,
"type": "R"
}
]
},
{
"viewerId": "oL0En04rCbHNSNdey_rFMAkLT-Ps",
"nickname": "ilyq69",
"totalScore": 0,
"answers": [
{
"questionId": "f7g2gtgtt9",
"questionName": "a",
"answer": "B",
"score": 0,
"type": "R"
},
{
"questionId": "f7g2gtgtyg",
"questionName": "b",
"answer": "B",
"score": 0,
"type": "R"
}
]
}
]
}
]
}

响应失败JSON示例:

未输入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": 400, 
  "status": "error", 
  "message": "param is not digit: dsadasd", 
  "data": ""
}

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为401,异常错误500(http状态码也跟code相同)
status 成功为success,失败为error
message 错误时为错误提示消息
data 成功时,返回用户答题结果及各个题目的统计信息,是个数组
questionnaireId 问卷ID,string
customQuestionnaireId 用户自定义问卷ID,string
questionnaireTitle 问卷名称,string
questionStats 问卷下各个问题的答题统计
questionStats.total 题目的答题人数,int
questionStats.questions 题目的答题统计信息,数组[]
questionStats.questions[].questionId 题目ID,string
questionStats.questions[].questionName 题目名称,string
questionStats.questions[].score 题目分数,int
questionStats.questions[].totalScore 题目的总得分,int
questionStats.questions[].correctCount 题目的答对人数,int
questionStats.questions[].a-g 选择项a到g分别的答题人数,int
users 观看端提交答题的信息
users[].viewerId 提交问卷的用户ID,string
users[].nickname 提交问卷的用户昵称,string
users[].totalScore 提交问卷的用户的总得分,int
users[].answers[] 用户每道题目的答题情况,数组 []
users[].answers[].questionId 题目ID,string
users[].answers[].questionName 题目名称,string
users[].answers[].answer 提交的题目答案,string
users[].answers[].score 用户答题的得分,string
users[].answers[].type 题目的类型,string,R 单选题 ,C 多项题 ,Q 问答题

php请求示例

<?php
//引用config.php
include 'config.php';

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => 195770,
  'startDate' => '2018-12-08',
  'endDate' => '2018-12-10'  
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
$params['sign'] = $sign;

$url = "http://api.polyv.net/live/v3/channel/questionnaire/answer-record?".http_build_query($params);

$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

获取签到结果

接口URL

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

接口说明

1、接口用于分页查询频道号下某一天的签到记录
2、接口支持https

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 13位当前时间戳
sign string 签名值
channelId int 频道号
page int 页码,默认为1
pageSize int 每一页的大小,默认为20
date string 查询的指定日期,格式为yyyy-MM-dd
sessionId string 场次sessionId,如果传sessionId, date无效,不传date有效

响应成功JSON示例:

{
  "code": 200,
  "status": "success",
  "message": "",
  "data": {
    "pageNumber": 1,
    "totalPages": 1,
    "pageSize": 20,
    "contents": [
      {
        "id": 491,
        "indate": "2018-08-07",
        "userid": "1533622191653",
        "channelId": 100538,
        "time": 1533622526801,
        "sessionId": "ffhkccipgf",
        "startTime": "2019-08-29 23:28:18",
        "timeFormat": "2018-08-07 14:15",
        "nickname": "广州观众/28838"
      },
      {
        "id": 492,
        "indate": "2018-08-07",
        "userid": "1533622191653",
        "channelId": 100538,
        "time": 1533623311065,
        "timeFormat": "2018-08-07 14:28",
        "nickname": "广州观众/28838"
        "sessionId": "ffhkccipgf",
        "startTime": "2019-08-29 23:28:18",
      },
      {
        "id": 493,
        "indate": "2018-08-07",
        "userid": "1533622191653",
        "channelId": 100538,
        "time": 1533636856928,
        "timeFormat": "2018-08-07 18:14",
        "nickname": "广州观众/28838"
        "sessionId": "ffhkccipgf",
        "startTime": "2019-08-29 23:28:18",
      },
      {
        "id": 494,
        "indate": "2018-08-07",
        "userid": "1533607482637",
        "channelId": 100538,
        "time": 1533636856932,
        "timeFormat": "2018-08-07 18:14",
        "nickname": "chromexr"
        "sessionId": "ffhkccipgf",
        "startTime": "2019-08-29 23:28:18",
      },
      {
        "id": 495,
        "indate": "2018-08-07",
        "userid": "1533625048644",
        "channelId": 100538,
        "time": 1533636875744,
        "timeFormat": "2018-08-07 18:14",
        "nickname": "ffxiaoru"
        "sessionId": "ffhkccipgf",
        "startTime": "2019-08-29 23:28:18",
      }
    ]
  }
}

响应失败JSON示例:

未输入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": ""
}

channelId为空

{
  "code": 400, 
  "status": "error", 
  "message": "param should not be empty: channelId", 
  "data": ""
}

channelId为非数字

{
  "code": 400, 
  "status": "error", 
  "message": "param is not number: channelId", 
  "data": ""
}

频道非法

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

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为401,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 签到记录的分页数据
pageNumber 页码
totalPages 总页数
pageSize 每一页大小
contents 签到记录数据数组
indate 查询的签到日期,yyyy-MM-dd格式
nickname 昵称
userid 用户id
channelId 频道号
time 签到的具体时间戳
timeFormat 签到的格式化详细日期,yyyy-MM-dd HH:mm 格式
sessionId 场次sessionId
startTime 该场次直播开始时间,如果不传sessionId,startTime为空;传sessionId,startTime显示

php请求示例

<?php

//引用config.php
include 'config.php';

//接口URL上变量
$appId = "es2vsst178";
$channelId="223350";
$date="2018-08-08";
$pageSize="20";
$page="1";
//接口需要的参数(非sign)赋值
$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => $channelId,
  'page' => $page,
  'pageSize' => $pageSize,
  'date' => $date
);

//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法

//接口请求url
$url = "https://api.polyv.net/live/v3/channel/checkin/list?appId=".$appId."&sign=".$sign."&timestamp=".$timestamp."&channelId=".$channelId."&page=".$page."&pageSize=".$pageSize."&date=".$date;

//输出接口请求结果
echo file_get_contents($url);

?>

签名规则(config.php文件代码查看)

http://dev.polyv.net/2018/liveproduct/l-api/rule/sign/

以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...