BotGuard爬虫管理
获取域名的Bot触发规则
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
domain | String | 是 | 域名。多个以;隔开 |
startTime | String | 是 | 开始时间。格式: yyyy-MM-dd HH:mm:ss |
endTime | String | 是 | 结束时间。格式: yyyy-MM-dd HH:mm:ss |
timeZone | Integer | 否 | 时区,默认8,即“GTM+8” |
lang | String | 否 | 语言类型。 默认cn en:英文 cn:中文 |
参数名称 | 类型 | 描述 |
---|---|---|
code | String | 状态码,成功为“200”。 |
message | String | 返回信息,成功为“Success”。 |
data | List | 返回数据 |
name | String | 规则名。 |
value | Long | 触发次数。 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
22994001 | CUSTOMER_NOT_EXIST | 200 | 客户不存在 |
22994000 | PARAM_ERROR_CODE | 200 | 查询参数错误 |
22995000 | INTERNAL_ERROR_CODE | 200 | 系统错误 |
#!/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/bot/report/top-rule-type \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "domain":"example1.xxx.xxx;example2.xxx.xxx;example3.xxx.xxx;", "startTime":"2021-12-03 00:00:00", "endTime":"2021-12-03 23:59:59" }'
{ "code" : 200, "message" : "", "data" : [ { "name" : "Rule Type1", "value" : 127 }, { "name" : "Rule Type2", "value" : 114 }, { "name" : "Rule Type3", "value" : 43 }, { "name" : "Rule Type4", "value" : 30 } ] }