预部署流媒体时间戳防盗链配置

更新时间:2022-12-05 16:28:30

适用产品

直播分发

接口描述

通过接口自助预部署流媒体时间戳防盗链。接口url的*可为域名名称或域名id。

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Path 参数

参数名称描述
*domainString
需要查询配置的域名或域名id

Body 参数

参数名称描述
*timestampVisitControlRulesList
流媒体时间戳防盗链配置,父标签 1. 需要设置流媒体时间戳防盗链配置时,此项必填 2. 为时清空配置
*cipherParamString
密文参数名称,未入参则默认值为wsSecret
*timeParamString
时间参数名称,未入参则默认值为wsTime
*secretKeyString
密钥
*timeFormatString
加密时间格式,必填,可选值为【UNIX timestamp】和【hex】,分别为【UNIX时间戳】、【16进制】。
effectiveTimeModeString
有效时间计算方式,可选值:duration、abstime、no verification 1. duration,表示按时长。设置为“按时长”,则effectiveTime必填。 2. abstime,表示按绝对时间。支持某个url到某个未来时间有效(最大支持3652天) 3. no verification,表示不校验时间。则自动清空effectiveTime。
effectiveTimeInteger
有效时长,单位秒(s),正整数,值要>=1。 有效时间计算方式为“按时长”时,该字段必填。
tolerantTimeInteger
容忍值,误差时间,单位秒(s),正整数,值要>=1 1. 当客户时间比我司的时间慢10s时,无需配置容忍,但是这样的话用户就会少看10秒 2. 当客户时间比我司的时间快10s时,需要配置容忍为10 ,但这样的话这用户也会少看了10秒
*cipheCombinationString
密文组合方式,可选值为以下六项: key+path+time key+time+path path+key+time path+time+key time+path+key time+key+path
dataIdInteger
配置多组配置时,具体某组配置的id。dataId可以通过查询接口获取。 注意: a、如果有传dataId,说明指定修改其中一组配置项内容,不需求修改其他组配置内容不需要入参; b、如果入参多组配置,其中有些组配置有传dataId,有些没有传,则有传dataId的表示修改具体某组配置,没有传dataId的表示在原来基础上新增一组配置; c、如果入参都没有传dataId,表示用本次的配置全量覆盖原先配置; d、如果入参没有传任何配置项参数,只传了域名和二级标签,表示清空这个接口对应域名二级服务所有配置; e、如果一组配置没有具体的配置项,则dataId必填,且值为实际存在的dataId,表示清空这个dataId对应配置项的值;不允许一组配置没有具体的配置项也没有dataId。

返回参数

Body 参数

参数名称描述
codeString
错误码
messageString
消息体
dataPredeployedStreamingTimestampVisitControlResponseData
返回数据体
preDeployIdString
预部署id
x-cnc-request-idString
唯一标示的id,用于查询每次请求的任务 (适用全部接口)

错误码

错误代码(code)描述(message)HTTP状态码语义
26939999We encountered an internal error. Please try again.500系统内部错误,请联系技术支持。
0success202更新成功
26938005No timestampVisitControlRules was specified.400timestampVisitControlRules节点未指定值(未传值)
26938005The specified cipherParam could not be blank.400cipherParam不能指定为空串
26938005The specified timeParam could not be blank.400timeParam 不能被指定为空串
26938005The timeFormat is invalid.400指定的timeFormat值不符合要求
26938005The effectiveTime is invalid.400指定的effectiveTime值不符合要求
26938005The tolerantTime is invalid.400指定的tolerantTime值不符合要求
26938005The cipheCombination is invalid.500指定的cipheCombination不符合要求
26938005The request has null config with null [data-id],please remove it.400请求的dataId 和 配置同时为空
26938005The specified secretKey could not be blank.400secretKey必传且不能指定为空串
26938005The specified timeFormat could not be blank.400timeFormat 必填且不能指定为空串
26938005No effectiveTime was specified.400effectiveTime 必传
26938005The specified cipheCombination could not be blank.400cipheCombination必传且不能指定为空串

示例

JSON
XML
JSON
请求示例
复制代码 复制成功
#!/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/predeploy/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":{"preDeployId":"226bd21c5fdf4e9f8e031aa9232a05b7"}}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!