直播分发
根据域名获取流名列表。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
dateFrom | 是 | 开始时间 1.格式为yyyy-MM-ddTHH:mm:ss+08:00; 2.必须小于当前时间和dateTo; 3.dateFrom和dateTo相差不能超过3天; 4.只能查询最近2年内数据。 | |
dateTo | 是 | 结束时间 1.格式为yyyy-MM-ddTHH:mm:ss+08:00; 2.必须大于dateFrom; | |
domain | 是 | 域名,需要符合正则(([\w-]{1,62})?(\.[\w-]{1,62})+) |
参数名称 | 类型 | 描述 |
---|---|---|
result | ||
domain | 域名 | |
streamList | 流名列表 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
MissingBody | This operation requires a body. Ensure that the body is present and the Content-Type header is set. | 400 | 请求体没有传递 |
NotAcceptable | The accept header specified in your request is not acceptable. | 400 | Accept请求头不支持,接口仅支持json格式 |
InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 | 请求体格式错误 |
InvalidDatePeriod | The date specified is invalid. | 400 | dateFrom或dateTo不符合规范 |
DateSpanError | You cannot specify a period greater than 3. | 400 | dateFrom和dateTo相差超过3天 |
PARAM_INVALID | param: domain is null or invalid. | 400 | 参数domain不符合规范 |
NoSuchDomain | The specified domain does not exist. | 404 | 传递的域名不存在 |
InternalError | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
#!/bin/bash # Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response username='example_username' apiKey='example_apiKey' date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"` password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64` curl -i --url "https://open.chinanetcenter.com/api/report/streamList" \ -X "GET" \ -H "X-Time-Zone:GMT+08:00" \ -u $username:$password \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{ "dateFrom": "2016-12-02T10:00:00+08:00", "dateTo": "2016-12-03T10:00:00+08:00", "domain": "www.test.com" }'
{ "result": [ { "domain": "www.test.com", "streamList": [ "www.test.com/abc/steam03", "www.test.com/abc/steam01", "www.test.com/abc/steam02" ] } ] }