获取API实例

获取频道某段时间的直播统计数据

官方文档:http://dev.polyv.net/2017/liveproduct/l-api/hqzbxx/summary/


$appId,
    'endDay'=>$endDay,
    'startDay'=>$startDay,
    'timestamp'=>$timestamp
  );


    // 1. 对加密数组进行字典排序
    foreach ($params as $key=>$value){
     $arr[$key] = $key;
    }
    sort($arr);
    $str = $appSecret;
    foreach ($arr as $k => $v) {
     $str = $str.$arr[$k].$params[$v];
    }
    $restr = $str.$appSecret;
    $sign = strtoupper(md5($restr));

//接口请求url
$url = "http://api.live.polyv.net/v2/statistics/".$channelId."/summary?timestamp=".$timestamp."&sign=".$sign."&endDay=".$endDay."&startDay=".$startDay."&appId=".$appId;
//输出接口请求结果
echo file_get_contents($url);
?>
 
 

你可能感兴趣的:(保利威视)