Ho kenya EstaCaido ka li-application tsa hau
The EstaCaido API u lumella ho laola li-monitors tsa hau, ho bona liketsahalo, ho hlophisa li-alerts le ho feta ho tsoa ho kotloloho. Li-endpoints tsohle tsa API li sebelisa JSON bakeng sa li-bodies tsa kopo le likarabo.
https://www.estacaido.com/api/v1/
Token ea API e ngoe le e ngoe e ka etsa ho fihlela ho lipotso tsa 100 ka metsotsoana. Lipotso tse ka holimo ho moeli ona li tla fumana karabo ea 429 Too Many Requests.
Senya ho nepahala ho nang le token bakeng sa lipotso tsohle tsa API. Tsebisa token ea hau ka ho le letona la ho lumellana.
/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
Hlahloba sebaka sa hau sa marang-rang.
/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 |
E hlokahala | Lebitso la monitor |
domain |
E hlokahala | Domain e tla hlahlojoa, mohlala example.com |
check_interval |
E ka ba teng | Nako e ka tlase ho metsotsoana e ka tlas'a ho hlahloba, e le 'ngoe ea 30, 60, 300, 600, 900, 1800, 3600. E tloaelehang: 300 |
check_type |
E ka ba teng | E 'ngoe ea litheko tsena: http, https, ping. Dipheto: 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 |
E ka ba teng | Libeke tse ka sehloohong tse lokelang ho kenyelletsoa. Bofela: 30 |
Bona liketsahalo tsa nako e sa sebetsaneng le histori ea tsona.
/api/v1/incidents/
status |
E ka ba teng | Sula ka boemo: e tsoelang pele, e rarolla |
monitor |
E ka ba teng | Sula ka ID ea monitor |
/api/v1/incidents/{id}/
Qwalasela li-notification tsa ho tšoaea li-monitors tsa hau.
/api/v1/alerts/
/api/v1/alerts/
monitor |
E hlokahala | Monitor ID |
alert_type |
E hlokahala | E 'ngoe ea litheko tsena: email, sms, slack, discord, webhook, pagerduty, teams |
recipients |
E hlokahala | Direkoto tsa mokha oa mokha oa mokha oa mokha |
alert_on_down |
E ka ba teng | Tsebisa ha sebaka se phutha (ho tloaelehile: 'nete) |
alert_on_recovery |
E ka ba teng | Tsebisa ha sebaka se khutlela morao (e tloaelehang: 'nete) |
/api/v1/alerts/{id}/
/api/v1/alerts/{id}/
E etsa le ho laola lihlooho tsa boemo ba sechaba.
/api/v1/status-pages/
/api/v1/status-pages/
title |
E hlokahala | Sehlooho sa leqephe la boemo |
slug |
E hlokahala | URL slug (e.g. my-status-page) |
description |
E ka ba teng | Tlhaloso ea mongolo |
is_public |
E ka ba teng | E etsa hore e fumaneha ka ho feletseng (e tloaelehang: 'nete) |
Hlahloba ho kena le ho sebetsana le sehlopha.
/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}'
Ho kenya le ho fumana API token ea hau ho qala ho hokahanya.
Ngodisa Mahala Fumana Token ea API