Integraasje fan EstaCaido mei jo applikaasjes
De EstaCaido API lit jo jo monitors beheare, foarfallen besjen, warskôgingen ynstelle en mear fanút jo eigen koade. Alle API- einpunten brûke JSON foar fersyk- en antwurdlichems.
https://www.estacaido.com/api/v1/
Elk API- token kin oant 100 100- fersiken per minút meitsje. Fersiken boppe dizze limyt krije in 429 Too Many Requests- antwurd.
Token- basearre ferifikaasje brûke foar alle API- fersiken. Nim jo token op yn de autorisaasjekop.
/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
Beheare jo websidemonitors.
/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 |
Ferantwurdlik | Namme fan it skerm |
domain |
Ferantwurdlik | Domein om te kontrolearjen, bygelyks example.com |
check_interval |
Opsjoneel | Kontroleinterval yn sekonden, ien fan 30, 60, 300, 600, 900, 1800, 3600. Standert: 300 |
check_type |
Opsjoneel | Ien fan dizze wearden: http, https, ping. Standert: 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 |
Opsjoneel | Oantal dagen om op te nimmen. Standert: 30 |
Besykje de ynhâld fan de skiednis en de skiednis fan de stêd.
/api/v1/incidents/
status |
Opsjoneel | Filterje op tastân: yn wurkjen, oplost |
monitor |
Opsjoneel | Filterje op skerm- ID |
/api/v1/incidents/{id}/
Configure alert notifications for your monitors.
/api/v1/alerts/
/api/v1/alerts/
monitor |
Ferantwurdlik | Skerm- ID |
alert_type |
Ferantwurdlik | Ien fan dizze wearden: email, sms, slack, discord, webhook, pagerduty, teams |
recipients |
Ferantwurdlik | Untfangeradressen of webhook URL- adressen |
alert_on_down |
Opsjoneel | Warskôgje as in side útfalt (standert: wier) |
alert_on_recovery |
Opsjoneel | Melde as de side wersteld is (standert: wier) |
/api/v1/alerts/{id}/
/api/v1/alerts/{id}/
Publieke tastânssiden oanmeitsje en beheare.
/api/v1/status-pages/
/api/v1/status-pages/
title |
Ferantwurdlik | Titel foar de tastânside |
slug |
Ferantwurdlik | URL- slug (bgl. my-status-page) |
description |
Opsjoneel | Beskriuwingstekst |
is_public |
Opsjoneel | Publiek tagonklik meitsje (standert: wier) |
Beheare team tagong en gearwurking.
/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}'
It is in keunstwurk en wurdt brûkt om de stêd te ferljochtsjen.
Registrearje fergees API- token ophelje