获取频道广告列表

接口URL

http://api.1588go.com/live/v3/channel/advert/list

接口说明

1、提供获取频道轮播广告列表信息,频道广告为空时,获取全局广告
2、支持https

支持格式

JSON

请求方式

GET

请求参数

参数名 必选 类型 说明
appId string 账号应用下的appId
timestamp string 当前时间的秒级时间戳(13位)
sign string 签名,为32位大写的MD5值
channelId int 频道号

操作成功响应示例

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": [
        {
            "text": "",
            "img": "//liveimages.videocc.net/uploaded/images/2019/09/ffmgstpk58.png",
            "href": ""
        },
        {
            "text": "123445",
            "img": "",
            "href": ""
        }
    ]
}

操作失败响应示例

签名错误

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

缺少参数 channelId

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

响应字段说明

名称 类型 说明
code string 响应代码,成功为200,失败为400,签名错误为403,异常错误500
status string 成功为success,失败为error
message string 错误时为错误提示消息
data object[] 成功响应数据
text string 文本广告内容
img string 图片广告链接
href string 跳转链接

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
$url = "https://api.1588go.com/live/v3/channel/advert/list?appId=".$appId."&sign=".$sign."&timestamp=".$timestamp."&channelId=".$channelId;
//输出接口请求结果
echo file_get_contents($url);

?>

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

http://dev.1588go.com/2018/liveproduct/l-api/rule/sign/

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

直接(独立)授权

一、功能路径

我的直播 --> 频道设置-->观看条件设置-->直接授权

二、功能介绍

打开直播观看页的时候URL需带上指定的参数,经过直播系统验证请求合法后,直接进入直播观看页,同时将用户所传参数作为观看页的观众信息进行设置,要求接口返回的观众账号具有唯一性,即同一个账号不能在两个地方同时登录,较早登录的账号会被踢出。

直接授权

  1. Secretkey:用于校验签名的生成。

三、直接授权流程详解

1. 将频道设置为直接授权后,通过后台或者api接口获取到用户直接授权观看条件的secretkey

2. 在请求保利威直播观看页时需带上相关参数,如
https://live.polyv.cn/watch/125527?userid=6b3a43&ts=1498547407000&sign=dd9dc9e42ad7c0204398e925a4ee0f46&nickname=viewerTests&avatar=http://livestatic.videocc.net/assets/wimages/missing_face.png

3.  直播系统会对用户提交的sign参数的值做比较判断是否合法,一次成功请求后,该链接将失效(sign只能成功使用一次)
如果合法,直播系统将使用nickname、userid、avatar,进入到保利威视直播观看页
聊天区将显示学员的昵称和头像。如果验证失败,则显示错误页面。

四、参数说明

参数 类型 必填 说明
userid string(仅支持英文大小写、数字和下划线) 观众ID,需要保证唯一性
ts long 13位毫秒级时间戳
sign string 用于校验的签名,生成规则是secretkey + userid + secretkey + ts进行MD5加密
nickname string 观众昵称,需要进行url安全的base64编码
avatar string 观众头像的url地址
param4 string 统计观众观看日志的自定义参数,需要先进行base64加密后再进行urlencode
param5 string 统计观众观看日志的自定义参数,需要先进行base64加密后再进行urlencode

五、代码示例(PHP)

<?php
$secretkey = "qwertyui"; //后台secretKey
$userid = "test" . rand(0, 5); //直播的用户ID
$ts = time() * 1000; //当前时间
$sign = md5($secretkey . $userid . $secretkey . $ts); //用于校验的sign
$nickname = urlencode(base64_encode("保利威")); //学员的昵称
$avatar = "http://live.1588go.com/assets/images/avatars/9avatar.jpg"; //学员的头像
$url = "https://live.polyv.cn/watch/108008";
$callbackUrl = $url . "?userid=" . $userid . "&nickname=" . $nickname . "&avatar=" . $avatar . "&ts=" . $ts . "&sign=" . $sign;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>login</title>
</head>
<body>
<div id="btn">
<input type="button" onclick="openurl()" value="独立授权观看" class="btn" >
</div>
<script>
function openurl(){
location.href="<?php
echo $callbackUrl ?>";
};
</script>
</form>
</body>
</html>

六、展示效果

http://demo.1588go.com/wfy/directAuth.php

七、注意事项

  1. .要保证提交的userid的唯一性,当多个观众使用同一个userid进入观看页时,较早登录的观众会被后面登录的观众踢出,观看页会提示 "帐号在另外的地方登录,您将被退出观看。"如下图:
    被踢
以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...

添加菜单

接口URL

http://api.1588go.com/live/v3/channel/menu/add

接口说明

1、作用:添加一个频道菜单
2、接口支持https协议

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp string 当前时间的秒级时间戳(13位)
sign string 签名,为32位大写的MD5值
channelId int 频道号
name string 菜单名称
type string 菜单类型
desc 直播介绍
chat 互动聊天
quiz 咨询提问
text 图文菜单
iframe推广外链
content string 菜单内容。
当菜单类型为直播介绍、图文菜单时,该值为菜单的内容。
当菜单类型为外链推广时,该值为外链链接地址。

操作成功响应示例

{
  "code": 200,
  "message": "",
  "data": {
    "menuId": "3b650cf438",
    "menuType": "iframe",
    "name": "推广菜单",
    "ordered": 6,
    "content": "http://1588go.com"
  }
}

操作失败响应示例

签名错误

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

缺少参数

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

参数长度过长

{
    "code": 400,
    "status": "error"
    "message": "param length is incorrect: name",
    "data": ""
}

菜单类型错误

{
    "code": 400,
    "status": "error"
    "message": "invalid menu type",
    "data": ""
}

已存在该类型的菜单(除 text、iframe 类型外,其他菜单都具有唯一性,重复添加相同类型时会返回错误)

{
    "code": 400,
    "status": "error"
    "message": "menu already exist",
    "data": ""
}

菜单数已达到上限(“咨询提问”之外,最多可以有6个菜单)

{
    "code": 400,
    "status": "error"
    "message": "menu count reached the limit",
    "data": ""
}

响应字段说明

名称 类型 说明
code string 响应代码,成功为200,失败为400,签名错误为401,异常错误500
status string 成功为success,失败为error
message string 错误时为错误提示消息
menuId string 菜单ID
menuType string 菜单类型
desc 直播介绍
chat 互动聊天
quiz 咨询提问
text 图文菜单
iframe推广外链
name string 菜单名称
ordered string 菜单顺序,值越小,越靠前。新添加的菜单默认位于最后。
content string 菜单内容

php请求示例

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

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => '123456',
  'name' => '菜单名称',
  'type' => 'text',
  'content' => '菜单内容'
);

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

$params["sign"] = $sign;
$url="http://api.1588go.com/live/v3/channel/menu/add?".http_build_query($params);

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);
?>

java请求示例

package com.live;

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;

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 com.live.util.EncryptionUtils;

public class Demo {


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

    public static void main(String[] args) {

        String url = "http://api.1588go.com/live/v3/channel/menu/add";
        String appId = "appId";
        String key = "secretKey";
        Map<String, String> map = new HashMap<>();
        map.put("appId", appId);
        map.put("timestamp", String.valueOf(System.currentTimeMillis()));
        map.put("channelId", "123456");
        map.put("name", "菜单名称");
        map.put("type", "text");
        map.put("content", "菜单内容");

        String sign = getSign(map, key);
        map.put("sign", sign);

        String body = "";
        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);

        System.out.println(urlStr);
        // 创建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;
    }
}

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

http://dev.1588go.com/2018/liveproduct/l-api/rule/sign/

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

修改菜单排序

接口URL

http://api.1588go.com/live/v3/channel/menu/update-rank

接口说明

1、作用:修改直播频道的菜单的顺序
2、接口支持https协议

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp string 当前时间的秒级时间戳(13位)
sign string 签名,为32位大写的MD5值
channelId int 频道号
menuIds string 频道菜单ID列表,必须是完整的列表(不能多也不能少),表示按该顺序排列菜单

操作成功响应示例

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

操作失败响应示例

签名错误

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

缺少参数 menuIds

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

菜单ID列表错误(缺少菜单ID,或者有多余的、错误的菜单ID)

{
    "code": 400,
    "status": "error"
    "message": "illegal menu id: menuIds",
    "data": ""
}

响应字段说明

名称 类型 说明
code string 响应代码,成功为200,失败为400,签名错误为401,异常错误500
status string 成功为success,失败为error
message string 错误时为错误提示消息

php请求示例

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

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => '123456',
  'menuIds' => '123,456'
);

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

$params["sign"] = $sign;
$url="http://api.1588go.com/live/v3/channel/menu/update-rank?".http_build_query($params);

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);
?>

java请求示例

package com.live;

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;

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 com.live.util.EncryptionUtils;

public class Demo {


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

    public static void main(String[] args) {

        String url = "http://api.1588go.com/live/v3/channel/menu/update-rank";
        String appId = "appId";
        String key = "secretKey";
        Map<String, String> map = new HashMap<>();
        map.put("appId", appId);
        map.put("timestamp", String.valueOf(System.currentTimeMillis()));
        map.put("channelId", "123456");
        map.put("menuIds", "123,456");

        String sign = getSign(map, key);
        map.put("sign", sign);

        String body = "";
        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);

        System.out.println(urlStr);
        // 创建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;
    }
}

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

http://dev.1588go.com/2018/liveproduct/l-api/rule/sign/

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

删除指定菜单

接口URL

http://api.1588go.com/live/v3/channel/menu/delete

接口说明

1、接口用于删除指定的频道菜单,支持批量
2、接口支持https

支持格式

JSON

请求方式

POST

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 13位当前时间戳
sign string 签名值
menuIds string 菜单id,指定多个以英文逗号,分隔

响应成功JSON示例:

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

响应失败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": ""
}

menuId分割后为空

{
  "code": 400, 
  "status": "error", 
  "message": "param length is incorrect: menuIds", 
  "data": ""
}

菜单不存在

{
  "code": 400, 
  "status": "error", 
  "message": "illegal menu id: test", 
  "data": ""
}

菜单类型不能删除

{
  "code": 400, 
  "status": "error", 
  "message": "can't delete special menu type", 
  "data": ""
}

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为401,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 成功响应时为本次成功删除的个数

php请求示例

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

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'menuIds' => "9991391d9d,ea4375fcfb"
);

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

$url = "http://api.1588go.com/live/v3/channel/menu/delete?".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.1588go.com/2018/liveproduct/l-api/rule/sign/

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

下载页面登记观看记录

接口URL

https://api.1588go.com/live/v3/channel/auth/download-record-info

接口说明

1、接口用于下载频道的登记观看列表,包含登记观看记录字段和数据内容
2、接口支持https

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 13位当前时间戳
sign string 签名值
rank int 1为首要条件,2为次要条件。影响导出的表格表头
channelId int 频道号

响应成功说明:

响应成功时,接口将返回文件流,格式为。xls,内容为导出的登记观看记录数据。

响应失败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": 404,
    "status": "error",
    "message": "channel not found.",
    "data": ""
}

字段说明

参数名 说明
code 响应代码,失败为400,签名错误为401,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 错误时为空串

php构建下载链接示例

<?php
//引用config.php
include '/srv/http/local.php';

$channelId="206204";

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

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

$url = "http://api.1588go.com/live/v3/channel/auth/download-record-info?".http_build_query($params);
// 输出构建后的下载链接
echo $url;
?>

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

http://dev.1588go.com/2018/liveproduct/l-api/rule/sign/

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

获取频道或全局登记观看字段

接口URL

https://api.1588go.com/live/v3/channel/auth/get-record-field

接口说明

1、接口用于获取频道或全局的登记观看字段
2、接口支持https

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 13位当前时间戳
sign string 签名值
rank int 主要观看条件为1,次要观看条件为2
channelId int 频道号,不填为获取全局

响应成功JSON示例:

{
  "code": 200, 
  "status": "success", 
  "message": "", 
  "data": [
    {
      "type": "name", 
      "name": "姓名", 
      "options": null, 
      "placeholder": "请输入姓名"
    }, 
    {
      "type": "mobile", 
      "name": "手机号码", 
      "options": null, 
      "placeholder": "请输入手机号码"
    }, 
    {
      "type": "number", 
      "name": "数字", 
      "options": null, 
      "placeholder": "请输入数字"
    }, 
    {
      "type": "option", 
      "name": "性别", 
      "options": "男,女", 
      "placeholder": "请选择性别"
    }
  ]
}

响应失败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": ""
}

频道不存在

{
  "code": 404, 
  "status": "error", 
  "message": "channel not found.", 
  "data": ""
}

频道非法

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

字段说明

参数名 说明
code 响应代码,成功为200,失败为400,签名错误为401,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 登记观看的字段信息
type 登记观看类型。name-姓名;mobile-手机号码;number-数字;option-下拉选择;text-文本
name 登记观看信息标题
placeholder 登记观看信息描述
options 登记观看为下拉选择时的选项,选项值以英文逗号分隔

php请求示例

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

$channelId="206204";
$rank = "1";

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

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

$url = "http://api.1588go.com/live/v3/channel/auth/get-record-field?".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);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>

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

http://dev.1588go.com/2018/liveproduct/l-api/rule/sign/

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

获取页面登记观看列表

接口URL

https://api.1588go.com/live/v3/channel/auth/get-record-info

接口说明

1、接口用于获取频道的登记观看列表数据内容
2、接口支持https

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 13位当前时间戳
sign string 签名值
channelId int 频道号
page int 要获取的页码,默认为1
pageSize int 每页数据量,默认为10

响应成功JSON示例:

{
  "code": 200, 
  "status": "success", 
  "message": "", 
  "data": {
    "pageNumber": 1, 
    "totalPages": 1, 
    "pageSize": 10, 
    "contents": [
      {
        "createdTime": 1531982204000, 
        "params": [
          "黄泉"
        ]
      }, 
      {
        "createdTime": 1531982194000, 
        "params": [
          "黄天"
        ]
      }, 
      {
        "createdTime": 1531982185000, 
        "params": [
          "小明"
        ]
      }, 
      {
        "createdTime": 1531814855000, 
        "params": [
          "ffff"
        ]
      }
    ]
  }
}

响应失败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 当前页面内容
createdTime 登记时间
params 登记的内容数据

php请求示例

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

$channelId="206204";

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => $channelId,
  'page' => '1',
  'pageSize' => '10'
);

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

$url = "http://api.1588go.com/live/v3/channel/auth/get-record-info?".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);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>

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

http://dev.1588go.com/2018/liveproduct/l-api/rule/sign/

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

获取页面观看白名单列表

接口URL

https://api.1588go.com/live/v3/channel/auth/get-white-list

接口说明

1、接口用于获取全局或频道的观看条件白名单列表
2、接口支持https

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 13位当前时间戳
sign string 签名值
rank int 1为首要条件,2为次要条件
channelId int 频道号,不传为获取全局设置
page int 要获取的页码,默认为1
pageSize int 每页数据量,默认为10
keyword string 关键词,可根据会员码和名称查询

响应成功JSON示例:

{
  "code": 200, 
  "status": "success", 
  "message": "", 
  "data": {
    "pageNumber": 1, 
    "totalPages": 4, 
    "pageSize": 5, 
    "contents": [
      {
        "name": "测试重构1", 
        "phone": "tes1", 
        "isVip": "N"
      }, 
      {
        "name": "测试重构10", 
        "phone": "tes10", 
        "isVip": "N"
      }, 
      {
        "name": "测试重构11", 
        "phone": "tes11", 
        "isVip": "N"
      }, 
      {
        "name": "测试重构12", 
        "phone": "tes12", 
        "isVip": "N"
      }, 
      {
        "name": "测试重构13", 
        "phone": "tes13", 
        "isVip": "N"
      }
    ]
  }
}

响应失败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,失败为400,签名错误为401,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 分页的白名单列表数据
pageNumber 当前页码
totalPages 页面总数
pageSize 每页数据量
contents 当前页面内容
name 昵称(或备注)
phone 会员码

php请求示例

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

$channelId="204758";

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'channelId' => $channelId,
  'rank' => '1',
  'page' => 1,
  'pageSize' => 5,
);

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

$url = "http://api.1588go.com/live/v3/channel/auth/get-white-list?".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);
$res = curl_exec($curl);
curl_close($curl);

echo $res;
?>

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

http://dev.1588go.com/2018/liveproduct/l-api/rule/sign/

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

下载页面观看白名单列表

接口URL

https://api.1588go.com/live/v3/channel/auth/download-white-list

接口说明

1、接口用于下载全局或频道的观看条件白名单列表
2、接口支持https

支持格式

JSON

请求方式

GET

请求数限制

TRUE

请求参数

参数名 必选 类型 说明
appId string 从API设置中获取,在直播系统登记的appId
timestamp long 13位当前时间戳
sign string 签名值
rank int 1为首要条件,2为次要条件
channelId int 频道号,要下载的频道号,不传为全局设置

响应成功说明:

响应成功时,接口将返回文件流,格式为.xls,内容为白名单列表数据。

响应失败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,签名错误为401,异常错误500
status 成功为success,失败为error
message 错误时为错误提示消息
data 由于成功时直接返回文件流下载,所以这里为空串

php构建下载链接示例

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

$channelId="204140";

$params = array(
  'appId' => $appId,
  'timestamp' => $timestamp,
  'rank' => '1'
);

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

$url = "http://api.1588go.com/live/v3/channel/auth/download-white-list?".http_build_query($params);
// 输出构建后的下载链接
echo $url;
?>

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

http://dev.1588go.com/2018/liveproduct/l-api/rule/sign/

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