애플리케이션과 EstaCaido 통합
EstaCaido API로 직접 작성한 코드에서 모니터 관리, 인시던트 조회, 알림 설정 등을 할 수 있습니다. 모든 API 엔드포인트는 요청과 응답 본문에 JSON을 사용합니다.
https://www.estacaido.com/api/v1/
각 API 토큰은 분당 최대 100회 요청할 수 있습니다. 제한을 넘으면 429 Too Many Requests 응답을 받습니다.
모든 API 요청에 토큰 인증을 사용합니다. 토큰을 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
웹사이트 모니터를 관리합니다.
/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 |
필수 | 모니터 이름 |
domain |
필수 | 모니터링할 도메인. 예: example.com |
check_interval |
선택 | 확인 간격(초), 30, 60, 300, 600, 900, 1800, 3600 중 하나. 기본값: 300 |
check_type |
선택 | 다음 값 중 하나: http, https, ping. 기본값: 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 |
선택 | 포함할 일수. 기본값: 30 |
다운타임 인시던트와 그 기록을 확인합니다.
/api/v1/incidents/
status |
선택 | 상태로 필터: ongoing, resolved |
monitor |
선택 | 모니터 ID로 필터 |
/api/v1/incidents/{id}/
모니터의 알림을 설정합니다.
/api/v1/alerts/
/api/v1/alerts/
monitor |
필수 | 모니터 ID |
alert_type |
필수 | 다음 값 중 하나: email, sms, slack, discord, webhook, pagerduty, teams |
recipients |
필수 | 수신자 주소 또는 웹훅 URL |
alert_on_down |
선택 | 사이트가 다운되면 알림 (기본값: true) |
alert_on_recovery |
선택 | 사이트가 복구되면 알림 (기본값: true) |
/api/v1/alerts/{id}/
/api/v1/alerts/{id}/
공개 상태 페이지를 만들고 관리합니다.
/api/v1/status-pages/
/api/v1/status-pages/
title |
필수 | 상태 페이지 제목 |
slug |
필수 | URL 슬러그 (예: my-status-page) |
description |
선택 | 설명 텍스트 |
is_public |
선택 | 공개 접근 허용 (기본값: true) |
팀 접근 권한과 협업을 관리합니다.
/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}'