Ampidiro anatin'ny rindranasanao ny EstaCaido
Ny API EstaCaido dia mamela anao hifehy ny mpanara-maso, hijery ny zava-mitranga, hamorona fampitandremana ary ny hafa amin'ny alalan'ny rindran'asao manokana. JSON no ampiasaina amin'ny fitakiana sy ny valinteny amin'ny farany rehetra amin'ny API.
https://www.estacaido.com/api/v1/
Afaka mandray fangatahana 100 isan-minitra ny token API tsirairay. Ny fangatahana mihoatra io fetra io dia mahazo valinteny 429 Too Many Requests.
Ampiasao ny fanamarinana mifototra amin'ny token ho an'ny fangatahana API rehetra. Ampidiro ao anatin'ny lohateny Authorization ny token-nao.
/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
Mifehy ny mpanara-maso ny tranonkalanao.
/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 |
Tsy maintsy atao | Anaran'ilay tontonana |
domain |
Tsy maintsy atao | Domain ho arahi-maso, ohatra example.com |
check_interval |
Tsy voatery | Check interval in seconds, one of 30, 60, 300, 600, 900, 1800, 3600. Default: 300 |
check_type |
Tsy voatery | Iray amin'ireto sanda ireto: http, https, ping. Lasitra: 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 |
Tsy voatery | Isan'andro tokony ampidirina. 30 ny sanda tsotra |
Jereo ny trangan-javatra tsy mandeha sy ny tantarany.
/api/v1/incidents/
status |
Tsy voatery | Sivana araka ny toe-draharaha: mitohy, voavaha |
monitor |
Tsy voatery | Sivana araka ny ID'ny monitor |
/api/v1/incidents/{id}/
Hikirakira ny fampilazana fampilazana ho an'ny mpanara-maso anao.
/api/v1/alerts/
/api/v1/alerts/
monitor |
Tsy maintsy atao | IDn'ny mpizaha |
alert_type |
Tsy maintsy atao | Iray amin'ireto sanda ireto: email, sms, slack, discord, webhook, pagerduty, teams |
recipients |
Tsy maintsy atao | Adiresy na URL webhook'ny mpandray |
alert_on_down |
Tsy voatery | Manambara rehefa mitsahatra ny tranonkala (tsotra: marina) |
alert_on_recovery |
Tsy voatery | Manambara rehefa miverina ny tranonkala (tsotra: marina) |
/api/v1/alerts/{id}/
/api/v1/alerts/{id}/
Hamorona sy hifehy pejy toetra ho an'ny daholobe.
/api/v1/status-pages/
/api/v1/status-pages/
title |
Tsy maintsy atao | Lohatenin'ny pejy toetra |
slug |
Tsy maintsy atao | URL slug (ohatra, my-status-page) |
description |
Tsy voatery | Soratra famaritana |
is_public |
Tsy voatery | Ataovy azo idirana ho an'ny rehetra (tsotra: marina) |
Mifehy ny fidirana sy ny fiaraha-miasa amin'ny ekipa.
/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}'
Misoratra anarana maimaimpoana ary mahazo ny token API-nao mba hanombohana ny fampidirana.
Misoratra anarana maimaim-poana Maka ny token'ny API