Tạo nối EstaCaido với các ứng dụng của bạn
API của EstaCaido cho phép bạn quản lý monitor, xem sự cố, cấu hình cảnh báo và nhiều việc khác ngay từ mã của bạn. Mọi endpoint API đều dùng JSON cho nội dung yêu cầu và phản hồi.
https://www.estacaido.com/api/v1/
Mỗi token API có thể gửi tối đa 100 yêu cầu mỗi phút. Yêu cầu vượt quá giới hạn sẽ nhận phản hồi 429 Too Many Requests.
Dùng xác thực bằng token cho mọi yêu cầu API. Đưa token của bạn vào header Authorization.
/api/v1/auth/token/
curl -X POST https://www.estacaido.com/api/v1/auth/token/ \
-H "Content-Type: application/json" \
-d '{"username": "your@email.com", "password": "yourpassword"}'
{
"token": "your-api-token-here"
}
Authorization: Token your-api-token-here
Quản lý các monitor website của bạn.
/api/v1/monitors/
[
{
"id": 1,
"name": "Production API",
"company": {
"id": 1,
"website": "api.example.com"
},
"check_type": "http",
"check_interval": 300,
"is_active": true,
"is_paused": false,
"last_check_at": "2024-01-15T10:30:00Z",
"created_at": "2024-01-01T00:00:00Z"
}
]
/api/v1/monitors/
name |
Bắt buộc | Tên của monitor |
domain |
Bắt buộc | Tên miền cần giám sát, ví dụ example.com |
check_interval |
Không bắt buộc | Khoảng thời gian kiểm tra tính bằng giây, một trong 30, 60, 300, 600, 900, 1800, 3600. Mặc định: 300 |
check_type |
Không bắt buộc | Một trong các giá trị: http, https, ping. Mặc định: https |
/api/v1/monitors/{id}/
/api/v1/monitors/{id}/
/api/v1/monitors/{id}/
/api/v1/monitors/{id}/pause/
/api/v1/monitors/{id}/resume/
/api/v1/monitors/{id}/statistics/
days |
Không bắt buộc | Số ngày cần bao gồm. Mặc định: 30 |
Xem các sự cố ngừng hoạt động và lịch sử của chúng.
/api/v1/incidents/
status |
Không bắt buộc | Lọc theo trạng thái: ongoing, resolved |
monitor |
Không bắt buộc | Lọc theo ID monitor |
/api/v1/incidents/{id}/
Cấu hình thông báo cảnh báo cho các monitor của bạn.
/api/v1/alerts/
/api/v1/alerts/
monitor |
Bắt buộc | ID monitor |
alert_type |
Bắt buộc | Một trong các giá trị: email, sms, slack, discord, webhook, pagerduty, teams |
recipients |
Bắt buộc | Địa chỉ người nhận hoặc URL webhook |
alert_on_down |
Không bắt buộc | Thông báo khi site ngừng hoạt động (mặc định: true) |
alert_on_recovery |
Không bắt buộc | Thông báo khi site hoạt động trở lại (mặc định: true) |
/api/v1/alerts/{id}/
/api/v1/alerts/{id}/
Tạo và quản lý các trang trạng thái công khai.
/api/v1/status-pages/
/api/v1/status-pages/
title |
Bắt buộc | Tiêu đề của trang trạng thái |
slug |
Bắt buộc | Slug URL (ví dụ my-status-page) |
description |
Không bắt buộc | Văn bản mô tả |
is_public |
Không bắt buộc | Cho phép truy cập công khai (mặc định: true) |
Quản lý quyền truy cập và cộng tác của nhóm.
/api/v1/teams/
/api/v1/teams/
/api/v1/teams/{id}/
import requests
API_TOKEN = 'your-api-token'
BASE_URL = 'https://www.estacaido.com/api/v1'
headers = {
'Authorization': f'Token {API_TOKEN}',
'Content-Type': 'application/json'
}
# List all monitors
response = requests.get(f'{BASE_URL}/monitors/', headers=headers)
monitors = response.json()
print(monitors)
# Create a new monitor
new_monitor = {
'name': 'My Website',
'domain': 'example.com',
'check_interval': 300
}
response = requests.post(f'{BASE_URL}/monitors/', json=new_monitor, headers=headers)
print(response.json())
const API_TOKEN = 'your-api-token';
const BASE_URL = 'https://www.estacaido.com/api/v1';
const headers = {
'Authorization': `Token ${API_TOKEN}`,
'Content-Type': 'application/json'
};
// List all monitors
fetch(`${BASE_URL}/monitors/`, { headers })
.then(res => res.json())
.then(monitors => console.log(monitors));
// Create a new monitor
fetch(`${BASE_URL}/monitors/`, {
method: 'POST',
headers,
body: JSON.stringify({
name: 'My Website',
domain: 'example.com',
check_interval: 300
})
})
.then(res => res.json())
.then(data => console.log(data));
# List all monitors
curl -X GET https://www.estacaido.com/api/v1/monitors/ \
-H "Authorization: Token your-api-token"
# Create a new monitor
curl -X POST https://www.estacaido.com/api/v1/monitors/ \
-H "Authorization: Token your-api-token" \
-H "Content-Type: application/json" \
-d '{"name": "My Website", "domain": "example.com", "check_interval": 300}'
Đăng ký miễn phí và lấy token API để bắt đầu tích hợp.
Đăng ký miễn phí Lấy token API