1. [IDC信息查询API](#idc信息查询api)
2. [违规用户API](#违规用户api)
此API提供了IDC信息的查询功能,包括获取IDC列表、单个IDC详情和可用平台列表。支持分页、搜索和多平台查询功能。
/api/query_idc_api.phpapplication/json- 方式1: 请求头中包含 API-Key: your_api_key
- 方式2: 查询参数中包含 apikey=your_api_key
#### 1. 获取可用平台列表
/api/query_idc_api.php?action=get_platformsGET - action: 固定值get_platforms
json
{
"platforms": [
{
"code": "iuca",
"name": "IUCA平台",
"is_editable": true
},
{
"code": "idcams",
"name": "IDCAMS平台",
"is_editable": false
},
{
"code": "hanhaiyun",
"name": "瀚海云平台",
"is_editable": false
}
],
"default_platform": "iuca"
}
#### 2. 获取IDC信息列表
/api/query_idc_api.phpGET - page: 页码(默认: 1)
- page_size: 每页数量(默认: 20,最大: 100)
- idc_name: IDC名称搜索(模糊匹配)
- domain: 域名搜索(模糊匹配)
- tags: 标签搜索(模糊匹配)
- platform: 平台代码,多个平台使用逗号分隔,例如:iuca,idcams,不指定则使用默认平台
json
{
"total": 100,
"page": 1,
"page_size": 20,
"platforms": ["iuca", "idcams"],
"data": [
{
"id": 1,
"idc_name": "示例IDC",
"website": "https://example.com",
"introduction": "示例IDC简介",
"authentication_type": "实名认证",
"operator_type": "企业",
"platform": "iuca",
"created_at": "2023-08-02 14:30:00",
"tags": ["高防", "CN2", "BGP"],
"logo_path": "/images/logo.png",
"verification_status": "verified",
"last_verification_date": "2023-09-01 10:00:00"
},
{
"id": 2,
"idc_name": "IDCAMS示例",
"website": "https://example2.com",
"platform": "idcams",
"created_at": "2023-08-03 10:00:00",
"tags": ["云服务器"],
"verification_status": "verified",
"last_verification_date": "2023-09-02 10:00:00"
},
...
]
}
#### 3. 获取单个IDC详情
/api/query_idc_api.php/{id}GET - id: IDC信息ID(必需)
- platform: 平台代码,不指定则使用默认平台
json
{
"id": 1,
"idc_name": "示例IDC",
"website": "https://example.com",
"introduction": "示例IDC简介",
"authentication_type": "实名认证",
"operator_type": "企业",
"platform": "iuca",
"created_at": "2023-08-02 14:30:00",
"tags": ["高防", "CN2", "BGP"],
"logo_path": "/images/logo.png",
"verification_status": "verified",
"last_verification_date": "2023-09-01 10:00:00",
"identifiers": [
{
"identifier": "EXAMPLE001",
"platform": "iuca"
},
{
"identifier": "ID001",
"platform": "idcams"
}
]
}
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"