直播分发
通过接口自助修改流媒体防盗链配置。接口url的*可为域名名称或域名id。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
domain-name | String | 否 | 需要查询配置的域名或域名id |
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
timestampVisitControlRules | List | 是 | 流媒体时间戳防盗链配置,父标签
1.需要设置流媒体时间戳防盗链配置时,此项必填
2.为 |
cipherParam | String | 是 | 密文参数名称,未入参则默认值为wsSecret |
timeParam | String | 是 | 时间参数名称,未入参则默认值为wsTime |
secretKey | String | 是 | 密钥 |
timeFormat | String | 是 | 加密时间格式,必填,可选值为【UNIX timestamp】和【hex】,分别为【UNIX时间戳】、【16进制】。 |
effectiveTimeMode | String | 否 | 有效时间计算方式,可选值:duration、abstime、no verification 1. duration,表示按时长。设置为“按时长”,则effectiveTime必填。 2. abstime,表示按绝对时间。支持某个url到某个未来时间有效(最大支持3652天) 3 .no verification,表示不校验时间。则自动清空effectiveTime。 |
effectiveTime | Integer | 否 | 有效时长,单位秒(s),正整数,值要>=1。 有效时间计算方式为“按时长”时,该字段必填。 |
tolerantTime | Integer | 否 | 容忍值,误差时间,单位秒(s),正整数,值要>=1 1. 当客户时间比我司的时间慢10s时,无需配置容忍,但是这样的话用户就会少看10秒 2. 当客户时间比我司的时间快10s时,需要配置容忍为10 ,但这样的话这用户也会少看了10秒 |
cipheCombination | String | 是 | 密文组合方式,可选值为以下六项: key+path+time key+time+path path+key+time path+time+key time+path+key time+key+path |
dataId | Integer | 否 | 配置多组配置时,具体某组配置的id。dataId可以通过查询接口获取。 注意: a、如果有传dataId,说明指定修改其中一组配置项内容,不需求修改其他组配置内容不需要入参; b、如果入参多组配置,其中有些组配置有传dataId,有些没有传,则有传dataId的表示修改具体某组配置,没有传dataId的表示在原来基础上新增一组配置; c、如果入参都没有传dataId,表示用本次的配置全量覆盖原先配置; d、如果入参没有传任何配置项参数,只传了域名和二级标签,表示清空这个接口对应域名二级服务所有配置; e、如果一组配置没有具体的配置项,则dataId必填,且值为实际存在的dataId,表示清空这个dataId对应配置项的值;不允许一组配置没有具体的配置项也没有dataId。 |
参数名称 | 类型 | 描述 |
---|---|---|
code | String | 错误码 |
message | String | 消息体 |
data | String | 返回数据体。 |
x-cnc-request-id | String | 唯一标示的id,用于查询每次请求的任务 (适用全部接口) |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
26939999 | We encountered an internal error. Please try again. | 500 | 系统内部错误,请联系技术支持。 |
0 | success | 202 | 更新成功 |
26938005 | No timestampVisitControlRules was specified. | 400 | timestampVisitControlRules节点未指定值(未传值) |
26938005 | The specified cipherParam could not be blank. | 400 | cipherParam不能指定为空串 |
26938005 | The specified timeParam could not be blank. | 400 | timeParam 不能被指定为空串 |
26938005 | The timeFormat is invalid. | 400 | 指定的timeFormat值不符合要求 |
26938005 | The effectiveTime is invalid. | 400 | 指定的effectiveTime值不符合要求 |
26938005 | The tolerantTime is invalid. | 400 | 指定的tolerantTime值不符合要求 |
26938005 | The cipheCombination is invalid. | 400 | 指定的cipheCombination不符合要求 |
26938005 | The request has null config with null [data-id],please remove it. | 400 | 请求的dataId 和 配置同时为空 |
26938005 | The specified secretKey could not be blank. | 400 | secretKey必传且不能指定为空串 |
26938005 | The specified timeFormat could not be blank. | 400 | timeFormat 必填且不能指定为空串 |
26938005 | No effectiveTime was specified. | 400 | effectiveTime 必传 |
26938005 | The specified cipheCombination could not be blank. | 400 | cipheCombination必传且不能指定为空串 |
#!/bin/bash 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/config/live-timestampvisitcontrol/123344" \ -X "PUT" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ -d ' { "timestampVisitControlRules":[{ "cipherParam":"wsSecret", "timeParam":"wsTime", "secretKey":"yoursecretkey", "timeFormat":"hex", "effectiveTimeMode":"duration", "effectiveTime":"3600", "tolerantTime":"60", "cipheCombination":"time+path+key" }] }'
HTTP/1.1 202 Accepted Date: Sun, 05 May 2019 09:08:53 GMT Content-Type: application/json;charset=utf-8 x-cnc-request-id: 83bbebc7-2c95-47d7 {"code":"0", "message":"success", "data":""}