文档中心 API文档 批量封禁域名URL接口

批量封禁域名URL接口

更新时间:2022-12-05 16:38:37

适用产品

网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、上网加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案

接口描述

批量新增域名封禁URL

推荐使用 Open API在线调试

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

请求参数

Body 参数

参数名称类型必填描述
isShared
Boolean是否要开启共享屏蔽,即域名和以这个域名共享缓存的域名的url需要一起屏蔽,入参值,true和false。 true表示要开启共享屏蔽,和共享删除屏蔽url 不填默认是false.
banUrls
List一个组需要非法信息屏蔽url的组合,每个url加匹配模式为一组。URL条数上限100个
url
Stringurl信息,必须是客户名下的非挂起域名的url。
method
String匹配方式,支持模糊和精确;模糊入参为:fuzzy;精确匹配:exact 如果没有传默认是exact

返回参数

Body 参数

参数名称类型描述
code
String错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型
message
String响应信息,成功时为success
data
String响应数据

错误码

错误代码(code)描述(message)HTTP状态码语义
26939999We encountered an system error. Please try again.500系统内部异常,请稍后重试
26937001This operation requires a body. Ensure that the body is present and the Content-Type header is set.400body内容为空
26937002The body of your HTTP request does not match with the content-type [xml/json].400请求报文与Content-Type描述不一致
26938005The value of isShared must be true or false.400isShared的值必须为true或者false
26938005No banUrls specified.400banUrls为空
26938005The number of banUrls is not allowed to exceed 100.400banUrls中的url条数不可超过100条
26932009The following ban-url cannot be associated with any domain, ban-urls:[$url].400屏蔽url未找到关联的域名
26938005The specified url could not be blank.400url不可为空
26938005The specified url is invalid.400url格式不正确
26932005The domain is being deleted403域名已挂起
26936010The specified user [$loginName] cannot operate following ban-url, ban-urls:[$url].400该用户无法操作指定的url
26938005The specified method could not be blank.400匹配方式不可为空
26938005The specified method is invalid.400匹配方式值错误
26935006Domain([$domainNameList]) has not opened illegal information blocking function, please contact technical support engineer.400域名未开通非法信息屏蔽功能
26935003Can not find effective config form by domain : [$domainName]400域名已无生效配置

示例

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/config/batchAddIllegalInformation" \
-X "PUT" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-d '{
    "isShared":true,
    "banUrls":[
        {"url":"http://www.example.com/1.html","method":"exact"}
        ,{"url":"http://www.example.com/2.html","method":"fuzzy"}
    ]
}'
返回示例
复制代码 复制成功
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":""}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!