当前接口根域名:
通用说明
请求地址:
{{DOMAIN}}/ApiClient.php请求方式:POST
字符编码:UTF-8
响应格式:JSON
Content-Type:application/x-www-form-urlencoded 或 application/json
地区代码说明
| 代码 | 地区 | 支持接口 |
|---|---|---|
| ningbo | 浙江宁波 | 全部接口 |
| suqian | 江苏宿迁 | 仅 add_whitelist(添加白名单) |
注意:不同接口的响应字段结构略有差异,以下文档已完全匹配接口实际返回格式,以各接口的响应示例为准。
浙江宁波 (ningbo) 完整接口
1. 添加白名单IP
POST请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | string | 是 | 固定值:add_whitelist |
| region | string | 是 | 固定值:ningbo |
| domain | string | 是 | 需要过白的域名 |
| ip | string | 是 | 需要过白的IP地址 |
| remark | string | 否 | 备注信息(可选) |
请求示例
POST {{DOMAIN}}/ApiClient.php
Content-Type: application/x-www-form-urlencoded
action=add_whitelist®ion=ningbo&domain=boxyun.com&ip=114.66.49.123&remark=业务过白
成功响应示例
{
"code": 200,
"msg": "添加成功",
"info": [
{
"boxyun.com": "ICP备88888888号\n"
}
]
}
2. 查询IP流量数据
POST请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | string | 是 | 固定值:query_traffic |
| region | string | 是 | 固定值:ningbo |
| ip | string | 是 | 要查询的IP地址 |
请求示例
POST {{DOMAIN}}/ApiClient.php
Content-Type: application/x-www-form-urlencoded
action=query_traffic®ion=ningbo&ip=114.66.49.123
成功响应示例
{
"code": 200,
"msg": {
"in_packets": 201,
"in_drop_other_size": 0,
"in_other_count": 0,
"in_icmp_size": 0,
"out_drop_tcp_size": 0,
"srvip": "114.66.49.123",
"in_syn_ack_size": 0,
"out_icmp_size": 0,
"in_ack_count": 201,
"out_udp_size": 0,
"out_drop_ack_size": 0,
"out_udp_count": 0,
"in_drop_tcp_size": 0,
"out_icmp_count": 0,
"in_udp_count": 0,
"out_other_count": 0,
"out_drop_other_size": 0,
"out_ack_size": 39885,
"in_drop_syn_ack_size": 0,
"out_total_connect_count": 0,
"out_syn_count": 0,
"in_total_connect_count": 38,
"in_tcp_other_count": 0,
"out_drop_packets": 0,
"out_syn_ack_count": 0,
"in_drop_packets": 0,
"in_drop_tcp_other_size": 0,
"in_other_size": 0,
"in_syn_size": 0,
"out_drop_syn_size": 0,
"out_connect_count": 0,
"in_tcp_count": 201,
"out_drop_syn_ack_size": 0,
"out_ack_count": 193,
"in_udp_size": 0,
"out_packets": 193,
"in_icmp_count": 0,
"out_syn_ack_size": 0,
"in_connect_count": 0,
"out_other_size": 0,
"out_tcp_other_count": 0,
"in_drop_size": 0,
"out_tcp_size": 39885,
"in_drop_udp_size": 0,
"out_size": 39885,
"out_drop_size": 0,
"out_tcp_count": 193,
"in_syn_count": 0,
"out_drop_icmp_size": 0,
"out_drop_udp_size": 0,
"in_size": 19018,
"in_drop_icmp_size": 0,
"out_tcp_other_size": 0,
"in_drop_syn_size": 0,
"in_tcp_other_size": 0,
"in_syn_ack_count": 0,
"in_drop_ack_size": 0,
"in_tcp_size": 19018,
"out_drop_tcp_other_size": 0,
"in_ack_size": 19018,
"out_syn_size": 0
}
}
3. 检查IP是否被封禁
POST请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | string | 是 | 固定值:check_ip_blocked |
| region | string | 是 | 固定值:ningbo |
| ip | string | 是 | 要检查的IP地址 |
请求示例
POST {{DOMAIN}}/ApiClient.php
Content-Type: application/x-www-form-urlencoded
action=check_ip_blocked®ion=ningbo&ip=127.0.0.1
成功响应示例
{
"code": 200,
"msg": {
"ip": "127.0.0.1",
"created_at": "2021-04-02 12:04:15",
"unclose_time": "2021-04-02 12:09:18",
"netflow_traffic": "0",
"route_type": "mobile"
}
}
响应字段说明
| 字段名 | 类型 | 说明 |
|---|---|---|
| ip | string | 查询的IP地址 |
| created_at | string | 被封禁的时间 |
| unclose_time | string | 预计解封时间 |
| netflow_traffic | string | 流量数据,值为0时通常是小包攻击过多导致封禁 |
| route_type | string | 流量方向 |
4. 查询IP封禁日志
POST请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | string | 是 | 固定值:query_ip_block_log |
| region | string | 是 | 固定值:ningbo |
| ip | string | 是 | 要查询的IP地址 |
请求示例
POST {{DOMAIN}}/ApiClient.php
Content-Type: application/x-www-form-urlencoded
action=query_ip_block_log®ion=ningbo&ip=127.0.0.1
成功响应示例
{
"code": 200,
"msg": [
{
"ip": "127.0.0.1",
"created_at": "2021-04-02 12:04:15",
"unclose_time": "2021-04-02 12:09:18",
"netflow_traffic": "0",
"route_type": "mobile"
}
]
}
说明:msg为数组格式,包含该IP的历史封禁记录,字段含义同「检查IP是否被封禁」接口。
江苏宿迁 (suqian) 接口
5. 添加白名单IP
POST注意:宿迁地区仅支持添加白名单接口,不支持流量查询、封禁检查、日志查询等其他接口。
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| action | string | 是 | 固定值:add_whitelist |
| region | string | 是 | 固定值:suqian |
| domain | string | 是 | 需要过白的域名 |
| ip | string | 是 | 需要过白的IP地址 |
| remark | string | 否 | 备注信息(可选) |
请求示例
POST {{DOMAIN}}/ApiClient.php
Content-Type: application/x-www-form-urlencoded
action=add_whitelist®ion=suqian&domain=boxyun.com&ip=114.66.49.123&remark=宿迁业务过白
响应示例
{"code":200,"status":1,"data":"请勿操作他人IP"}
说明:宿迁接口返回格式与宁波不同,以实际返回的字段为准。