1. [IDC信息查询API (queryidc)](#idc信息查询api-queryidc)
2. [违规用户API](#违规用户api)
此API提供了IDC信息的查询功能,支持多平台查询、多条件筛选。支持跨域请求。
/api/queryidc.phpapplication/jsonGET, POST - 方式1: 请求头中包含 API-Key: your_api_key
- 方式2: 查询参数中包含 apikey=your_api_key
API支持CORS跨域请求,包含以下响应头:
Access-Control-Allow-Origin: *Access-Control-Allow-Methods: GET, POST, OPTIONSAccess-Control-Allow-Headers: Content-Type, API-Key, APIKey, Authorization, X-Requested-With, Accept, OriginAccess-Control-Allow-Credentials: true#### 1. 获取可用平台列表
/api/queryidc.php?action=get_platformsGET / POST - action: 固定值 get_platforms
bash
使用请求头认证
curl -H "API-Key: your_api_key" "https://example.com/api/queryidc.php?action=get_platforms"
使用查询参数认证
curl "https://example.com/api/queryidc.php?apikey=your_api_key&action=get_platforms"
json
{
"success": true,
"platforms": ["iuca", "idcams", "ccu", "ztre"]
}
#### 2. 查询IDC信息
/api/queryidc.phpGET / POST请求参数:
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| platform | string | 否 | 指定查询平台(如 iuca, idcams, ztre, ccu),不指定则查询所有平台。若指定不存在的平台将返回错误 |
| idc_name | string | 否 | IDC名称(模糊匹配) |
| domain | string | 否 | 域名(模糊匹配) |
| status | string | 否 | 状态筛选,多个状态用逗号分隔 |
| authentication | string | 否 | 认证状态筛选,多个状态用逗号分隔 |
| identifier | string | 否 | 标识码(精确匹配) |
| operator_type | string | 否 | 运营方类型筛选,多个类型用逗号分隔 |
平台验证说明:
platform 参数时,系统会验证平台是否存在状态值说明:
IUCA平台:
| 状态值 | 说明 |
|--------|------|
| normal | 正常 |
| closed | 倒闭 |
| runaway | 跑路 |
| unknown | 未知 |
| abnormal | 异常 |
IDCAMS平台(通过运营方类型判断状态):
| 运营方类型值 | 说明 |
|-----|------|
| 9 | 跑路 |
| 11 | 停运 |
| 12 | 异常 |
| 其他 | 正常运营 |
认证状态说明:
IUCA平台:
| 认证值 | 说明 |
|--------|------|
| unverified | 未认证 |
| normal | 普通认证 |
| premium | 高级认证 |
| enterprise | 企业认证 |
IDCAMS平台:
| 认证值 | 说明 |
|--------|------|
| 1 | 官方认证 |
| 2 | 未认证 |
运营方类型说明:
IUCA平台:
| 值 | 说明 |
|-----|------|
| individual_licensed | 个体工商户有证经营 |
| individual_unlicensed | 个体工商户无证经营 |
| enterprise_licensed | 企业有证经营 |
| enterprise_unlicensed | 企业无证经营 |
| personal | 个人经营 |
| nonprofit_licensed | 非营利性企业有证经营 |
| nonprofit_unlicensed | 非营利性企业无证经营 |
| unknown | 未知 |
IDCAMS平台:
| 值 | 说明 |
|-----|------|
| 0 | 未知 |
| 1 | 个体工商户有营业执照经营 |
| 2 | 个人经营 |
| 3 | 企业有证经营 |
| 4 | 企业无证经营 |
| 5 | 企业无证但提供了可信资质证明 |
| 6 | 企业有营业执照但无证 |
| 7 | 企业正在办证 |
| 8 | 企业有有证企业的授权 |
| 9 | 跑路 |
| 10 | 工作室/团队经营 |
| 11 | 停运 |
| 12 | 异常,无法联系到上传方 |
bash
GET请求 - 使用请求头认证
curl -H "API-Key: your_api_key" "https://example.com/api/queryidc.php?platform=iuca&status=normal,closed"
GET请求 - 使用查询参数认证
curl "https://example.com/api/queryidc.php?apikey=your_api_key&idc_name=测试"
GET请求 - 按运营方类型筛选
curl "https://example.com/api/queryidc.php?apikey=your_api_key&platform=iuca&operator_type=enterprise_licensed,individual_licensed"
POST请求 - JSON格式
curl -X POST \
-H "Content-Type: application/json" \
-H "API-Key: your_api_key" \
-d '{"idc_name":"测试","authentication":"premium,enterprise"}' \
"https://example.com/api/queryidc.php"
POST请求 - JSON格式(包含运营方类型筛选)
curl -X POST \
-H "Content-Type: application/json" \
-H "API-Key: your_api_key" \
-d '{"platform":"iuca","operator_type":"enterprise_licensed"}' \
"https://example.com/api/queryidc.php"
POST请求 - 表单格式
curl -X POST \
-H "API-Key: your_api_key" \
-d "idc_name=测试&status=normal" \
"https://example.com/api/queryidc.php"
IUCA平台响应(标准化格式):
json
{
"success": true,
"count": 1,
"data": [
{
"idc_name": "示例IDC",
"website": "https://example.com",
"company_name": "示例科技有限公司",
"contact_info": "QQ:123456789",
"email": "contact@example.com",
"status": "normal",
"status_text": "正常",
"authentication": "premium",
"authentication_text": "高级认证",
"telecom_license": "京ICP备12345678号",
"operator_type": "企业有证经营",
"identifier": "IUCA001",
"logo": "get_logo.php?id=1",
"created_at": "2023-08-02 14:30:00",
"tags": ["高防", "CN2", "BGP"],
"platform": "iuca"
}
]
}
其他平台响应(原始API数据):
json
{
"success": true,
"count": 1,
"data": [
{
"id": 123,
"description": "示例IDC",
"web": "https://example.com",
"uploader": "admin",
"upload_time": "2023-08-02 14:30:00",
"upstatus": 1,
"idc_status": {"status": 3},
"code": "IDCAMS001",
"logo": "https://mcddos.top/idc/xxx.png",
"platform": "idcams"
}
]
}
#### IUCA平台字段(标准化格式)
| 字段 | 类型 | 说明 |
|------|------|------|
| idc_name | string | IDC名称 |
| website | string | 官网地址 |
| company_name | string | 公司名称 |
| contact_info | string | 联系方式 |
| email | string | 邮箱 |
| status | string | 状态代码 |
| status_text | string | 状态文本 |
| authentication | string | 认证状态代码 |
| authentication_text | string | 认证状态文本 |
| telecom_license | string | 增值电信业务经营许可证号 |
| operator_type | string | 运营方类型 |
| identifier | string | 标识码 |
| logo | string | Logo URL(IUCA平台返回 get_logo.php?id=X 格式) |
| created_at | string | 登记时间 |
| tags | array | 标签列表 |
| platform | string | 所属平台 |
#### 其他平台字段
其他平台(idcams, ztre, ccu)返回原始API数据,仅额外添加以下字段:
| 字段 | 类型 | 说明 |
|------|------|------|
| logo | string | 拼接后的完整Logo URL |
| platform | string | 所属平台 |
> 注意: 其他平台的字段名称和数据结构取决于对应平台的API返回,请参考各平台的原始API文档。
API密钥无效:
json
{
"success": false,
"error": "API密钥无效或已禁用",
"code": "INVALID_API_KEY"
}
平台不存在:
json
{
"success": false,
"error": "平台 'invalid' 不存在或不可用",
"code": "INVALID_PLATFORM",
"available_platforms": ["iuca", "idcams", "ccu", "ztre"]
}
服务器错误:
json
{
"success": false,
"error": "错误描述信息",
"code": "SERVER_ERROR"
}
---
pending(待审核),需要管理员审核后才能变为approved(已审核)modification_pending(修改待审核)approvedapproved(已审核)和modification_pending(修改待审核)的用户,不返回pending(待审核)状态的用户/api/violation_users_api.phpapplication/json- 方式1: 请求头中包含 API-Key: your_api_key
- 方式2: 查询参数中包含 apikey=your_api_key
/api/violation_users_api.phpGET - page: 页码(默认: 1)
- page_size: 每页数量(默认: 20)
- name: 姓名搜索(模糊匹配)
- contact_info: 联系方式搜索(模糊匹配)
- ip_addresses: IP地址搜索(模糊匹配)
- status: 状态筛选(可选值: approved, pending, modification_pending),默认只返回approved和modification_pending状态的用户
json
{
"total": 100,
"page": 1,
"page_size": 20,
"data": [
{
"id": 1,
"name": "张三",
"contact_info": ["zhangsan@example.com", "13800138000"],
"contact_type": ["email", "phone"],
"ip_addresses": "192.168.1.1, 10.0.0.1",
"reporter_email": "admin@example.com",
// 注意:不能直接设置为'appoved',系统会自动设置为'modification_pending'
// "status": "approved", // 此参数无效
"created_at": "2023-08-02 14:30:00",
"reasons": ["违规内容1", "违规内容2"]
},
...
]
}
/api/violation_users_api.php/{id}GET - id: 违规用户ID(必需)
json
{
"id": 1,
"name": "张三",
"contact_info": ["zhangsan@example.com", "13800138000"],
"contact_type": ["email", "phone"],
"ip_addresses": "192.168.1.1, 10.0.0.1",
"reporter_email": "admin@example.com",
"status": "approved",
"created_at": "2023-08-02 14:30:00",
"reasons": ["违规内容1", "违规内容2"]
}
/api/violation_users_api.phpPOSTjson
{
"name": "张三",
"contact_info": ["zhangsan@example.com", "13800138000"],
"contact_type": ["email", "phone"],
"ip_addresses": "192.168.1.1, 10.0.0.1",
"reporter_email": "admin@example.com",
// 注意:status参数会被忽略,新添加用户总是设置为'pending'
"status": "pending", // 此参数会被忽略
"reasons": ["违规内容1", "违规内容2"]
}
- contact_info: 联系方式数组(至少一个)
- contact_type: 联系方式类型数组(与联系方式数量匹配)
- reporter_email: 有效的邮箱地址
- reasons: 违规原因数组(至少一个非空)
/api/violation_users_api.php/{id}PUT - id: 违规用户ID(必需)
json
{
"name": "张三(更新)",
"status": "approved",
"reasons": ["更新后的违规原因"]
}
API会返回适当的HTTP状态码和错误信息:
400: 请求参数错误401: 未提供API密钥或密钥无效404: 资源不存在500: 服务器内部错误错误响应格式:
json
{
"error": "错误描述信息"
}
bash
curl -X GET "http://yourdomain.com/api/violation_users_api.php?page=1&page_size=10&name=张三" \
-H "API-Key: your_api_key"
bash
curl -X GET "http://yourdomain.com/api/violation_users_api.php?page=1&page_size=10&name=张三&apikey=your_api_key"
bash
curl -X POST "http://yourdomain.com/api/violation_users_api.php" \
-H "Content-Type: application/json" \
-H "API-Key: your_api_key" \
-d '{"name":"张三","contact_info":["zhangsan@example.com"],"contact_type":["email"],"reporter_email":"admin@example.com","reasons":["违规内容"]}'
bash
curl -X POST "http://yourdomain.com/api/violation_users_api.php?apikey=your_api_key" \
-H "Content-Type: application/json" \
-d '{"name":"张三","contact_info":["zhangsan@example.com"],"contact_type":["email"],"reporter_email":"admin@example.com","reasons":["违规内容"]}'
bash
curl -X PUT "http://yourdomain.com/api/violation_users_api.php/1" \
-H "Content-Type: application/json" \
-H "API-Key: your_api_key" \
-d '{"name":"张三(更新)","reasons":["更新后的违规原因"]}'
bash
curl -X PUT "http://yourdomain.com/api/violation_users_api.php/1?apikey=your_api_key" \
-H "Content-Type: application/json" \
-d '{"name":"张三(更新)","reasons":["更新后的违规原因"]}'
bash
curl -X DELETE "http://yourdomain.com/api/violation_users_api.php/1" \
-H "API-Key: your_api_key"
bash
curl -X DELETE "http://yourdomain.com/api/violation_users_api.php/1?apikey=your_api_key"