网络监控
GET https://www.hostmonits.com/api/monitors/
curl --request GET \
--url 'https://www.hostmonits.com/api/monitors/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.hostmonits.com/api/monitors/' \
--header 'Authorization: Bearer {api_key}' \
| 请求参数 | 详情 | 描述 |
|---|---|---|
| search | 选填 字符串 | 搜索关键词. |
| search_by | 选填 字符串 | 搜索匹配字段,可选值:name, target. |
| is_enabled | 选填 布尔型 | |
| type | 选填 字符串 | 可选值:website, ping, port |
| ping_servers_ids | 选填 整型 | 可选值:1 |
| project_id | 选填 整型 | |
| datetime_field | 选填 字符串 | 可选值:datetime, last_datetime, last_check_datetime |
| datetime_start | 选填 字符串 | 起始时间,格式 年-月-日 时:分:秒. |
| datetime_end | 选填 字符串 | 结束时间,格式 年-月-日 时:分:秒. |
| order_by | 选填 字符串 | 排序字段,可选值:monitor_id, datetime, last_datetime, last_check_datetime, name, uptime, average_response_time. |
| order_type | 选填 字符串 | 排序方式:ASC 升序,DESC 降序. |
| page | 选填 整型 | 数据页码,默认值 1. |
| results_per_page | 选填 整型 | 每页返回数据条数,可选值:10, 25, 50, 100, 250, 500, 1000,默认值 25. |
{
"data": [
{
"id": 1,
"project_id": 0,
"name": "Example",
"type": "website",
"target": "https://example.com/",
"port": 0,
"settings": {
"check_interval_seconds": 3600,
"timeout_seconds": 1,
"request_method": "GET",
"request_body": "",
"request_basic_auth_username": "",
"request_basic_auth_password": "",
"request_headers": [],
"response_status_code": 200,
"response_body": "",
"response_headers": []
},
"ping_servers_ids": [1],
"is_ok": 1,
"uptime": 95.5,
"downtime": 4.5,
"average_response_time": 500,
"total_checks": 500,
"total_ok_checks": 450,
"total_not_ok_checks": 50,
"last_check_datetime": "2021-03-25 08:27:07",
"notifications": {
"email_is_enabled": 0,
"webhook":"",
"slack":"",
"twilio":""
},
"is_enabled": false,
"datetime": "2026-06-22 06:45:54",
}
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://www.hostmonits.com/api/monitors?page=1",
"last": "https://www.hostmonits.com/api/monitors?page=1",
"next": null,
"prev": null,
"self": "https://www.hostmonits.com/api/monitors?page=1"
}
}
GET https://www.hostmonits.com/api/monitors/{monitor_id}
curl --request GET \
--url 'https://www.hostmonits.com/api/monitors/{monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.hostmonits.com/api/monitors/{monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"project_id": 0,
"name": "Example",
"type": "website",
"target": "https://example.com/",
"port": 0,
"settings": {
"check_interval_seconds": 3600,
"timeout_seconds": 1,
"request_method": "GET",
"request_body": "",
"request_basic_auth_username": "",
"request_basic_auth_password": "",
"request_headers": [],
"response_status_code": 200,
"response_body": "",
"response_headers": []
},
"ping_servers_ids": [1],
"is_ok": 1,
"uptime": 95.5,
"downtime": 4.5,
"average_response_time": 500,
"total_checks": 500,
"total_ok_checks": 450,
"total_not_ok_checks": 50,
"last_check_datetime": "2021-03-25 08:27:07",
"notifications": {
"email_is_enabled": 0,
"webhook":"",
"slack":"",
"twilio":""
},
"is_enabled": false,
"datetime": "2026-06-22 06:45:54",
}
}
POST https://www.hostmonits.com/api/monitors
| 请求参数 | 详情 | 描述 |
|---|---|---|
| name | 必填 字符串 | - |
| target | 必填 字符串 | - |
| port | 选填 字符串 | - |
| type | 选填 字符串 | 可选值:website, ping, port |
| project_id | 选填 整型 | - |
| ping_servers_ids | 选填 数组 | 可选值:1 |
| check_interval_seconds | 选填 整型 | 可选值:60, 180, 300, 600, 1800, 3600, 21600, 43200, 86400 (秒) |
| timeout_seconds | 选填 整型 | 可选值:1, 2, 3, 5, 10, 25 (秒) |
| ping_ipv | 选填 字符串 |
生效条件:type = ping 可选值: ipv4, ipv6 |
| request_method | 选填 字符串 | 可选值:HEAD, GET, POST, PUT, PATCH |
| request_body | 选填 字符串 | - |
| request_basic_auth_username | 选填 字符串 | - |
| request_basic_auth_password | 选填 字符串 | - |
| request_header_name | 选填 数组 | - |
| request_header_value | 选填 数组 | - |
| response_status_code | 选填 整型 | - |
| response_body | 选填 字符串 | - |
| response_header_name | 选填 字符串 | - |
| response_header_value | 选填 字符串 | - |
| is_ok_notifications | 选填 数组 | 通知渠道ID |
| email_reports_is_enabled | 选填 布尔型 | - |
| cache_buster_is_enabled | 选填 布尔型 | - |
| verify_ssl_is_enabled | 选填 布尔型 | - |
| is_enabled | 选填 布尔型 | - |
curl --request POST \
--url 'https://www.hostmonits.com/api/monitors' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'target=https://example.com/' \
--url 'https://www.hostmonits.com/api/monitors' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'target=https://example.com/' \
{
"data": {
"id": 1
}
}
POST https://www.hostmonits.com/api/monitors/{monitor_id}
| 请求参数 | 详情 | 描述 |
|---|---|---|
| name | 选填 字符串 | - |
| target | 选填 字符串 | - |
| port | 选填 字符串 | - |
| type | 选填 字符串 | 可选值:website, ping, port |
| project_id | 选填 整型 | - |
| ping_servers_ids | 选填 数组 | 可选值:1 |
| check_interval_seconds | 选填 整型 | 可选值:60, 180, 300, 600, 1800, 3600, 21600, 43200, 86400 (秒) |
| timeout_seconds | 选填 整型 | 可选值:1, 2, 3, 5, 10, 25 (秒) |
| ping_ipv | 选填 字符串 |
生效条件:type = ping 可选值: ipv4, ipv6 |
| request_method | 选填 字符串 | 可选值:HEAD, GET, POST, PUT, PATCH |
| request_body | 选填 字符串 | - |
| request_basic_auth_username | 选填 字符串 | - |
| request_basic_auth_password | 选填 字符串 | - |
| request_header_name | 选填 数组 | - |
| request_header_value | 选填 数组 | - |
| response_status_code | 选填 整型 | - |
| response_body | 选填 字符串 | - |
| response_header_name | 选填 字符串 | - |
| response_header_value | 选填 字符串 | - |
| is_ok_notifications | 选填 数组 | 通知渠道ID |
| email_reports_is_enabled | 选填 布尔型 | - |
| cache_buster_is_enabled | 选填 布尔型 | - |
| verify_ssl_is_enabled | 选填 布尔型 | - |
| is_enabled | 选填 布尔型 | - |
curl --request POST \
--url 'https://www.hostmonits.com/api/monitors/{monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--url 'https://www.hostmonits.com/api/monitors/{monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
{
"data": {
"id": 1
}
}
DELETE https://www.hostmonits.com/api/monitors/{monitor_id}
curl --request DELETE \
--url 'https://www.hostmonits.com/api/monitors/{monitor_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://www.hostmonits.com/api/monitors/{monitor_id}' \
--header 'Authorization: Bearer {api_key}' \