API 문서화

애플리케이션과 EstaCaido 통합

시작하기

EstaCaido API로 직접 작성한 코드에서 모니터 관리, 인시던트 조회, 알림 설정 등을 할 수 있습니다. 모든 API 엔드포인트는 요청과 응답 본문에 JSON을 사용합니다.

기본 URL

https://www.estacaido.com/api/v1/

요청 제한

각 API 토큰은 분당 최대 100회 요청할 수 있습니다. 제한을 넘으면 429 Too Many Requests 응답을 받습니다.

인증

모든 API 요청에 토큰 인증을 사용합니다. 토큰을 Authorization 헤더에 포함하세요.

인증 토큰 받기

POST /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 헤더에 토큰을 사용하세요

Authorization: Token your-api-token-here

모니터

웹사이트 모니터를 관리합니다.

모니터 목록

GET /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"
  }
]

모니터 만들기

POST /api/v1/monitors/
매개변수
name 필수 모니터 이름
domain 필수 모니터링할 도메인. 예: example.com
check_interval 선택 확인 간격(초), 30, 60, 300, 600, 900, 1800, 3600 중 하나. 기본값: 300
check_type 선택 다음 값 중 하나: http, https, ping. 기본값: https

모니터 조회

GET /api/v1/monitors/{id}/

모니터 업데이트

PUT /api/v1/monitors/{id}/

모니터 삭제

DELETE /api/v1/monitors/{id}/

모니터 일시중지

POST /api/v1/monitors/{id}/pause/

모니터 재개

POST /api/v1/monitors/{id}/resume/

모니터 통계 조회

GET /api/v1/monitors/{id}/statistics/
매개변수
days 선택 포함할 일수. 기본값: 30

인시던트

다운타임 인시던트와 그 기록을 확인합니다.

인시던트 목록

GET /api/v1/incidents/
매개변수
status 선택 상태로 필터: ongoing, resolved
monitor 선택 모니터 ID로 필터

인시던트 조회

GET /api/v1/incidents/{id}/

알림

모니터의 알림을 설정합니다.

알림 목록

GET /api/v1/alerts/

알림 만들기

POST /api/v1/alerts/
매개변수
monitor 필수 모니터 ID
alert_type 필수 다음 값 중 하나: email, sms, slack, discord, webhook, pagerduty, teams
recipients 필수 수신자 주소 또는 웹훅 URL
alert_on_down 선택 사이트가 다운되면 알림 (기본값: true)
alert_on_recovery 선택 사이트가 복구되면 알림 (기본값: true)

알림 업데이트

PUT /api/v1/alerts/{id}/

알림 삭제

DELETE /api/v1/alerts/{id}/

상태 페이지

공개 상태 페이지를 만들고 관리합니다.

상태 페이지 목록

GET /api/v1/status-pages/

상태 페이지 만들기

POST /api/v1/status-pages/
매개변수
title 필수 상태 페이지 제목
slug 필수 URL 슬러그 (예: my-status-page)
description 선택 설명 텍스트
is_public 선택 공개 접근 허용 (기본값: true)

팀

팀 접근 권한과 협업을 관리합니다.

팀 목록

GET /api/v1/teams/

팀 만들기

POST /api/v1/teams/

팀 조회

GET /api/v1/teams/{id}/

코드 예시

Python

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())

JavaScript

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));

cURL

# 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}'

시작할 준비가 되셨나요?

무료로 가입하고 API 토큰을 받아 연동을 시작하세요.

무료 가입 API 토큰 받기