API dokumintaasje

Integraasje fan EstaCaido mei jo applikaasjes

Begjinne

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.

Basis URL- adres

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

Frekwinsjelimyt

Elk API- token kin oant 100 100- fersiken per minút meitsje. Fersiken boppe dizze limyt krije in 429 Too Many Requests- antwurd.

Ferifikaasje

Token- basearre ferifikaasje brûke foar alle API- fersiken. Nim jo token op yn de autorisaasjekop.

Ferifikaasjetoken ophelje

POST /api/v1/auth/token/
Fersyk
curl -X POST https://www.estacaido.com/api/v1/auth/token/ \
  -H "Content-Type: application/json" \
  -d '{"username": "your@email.com", "password": "yourpassword"}'
Antwurd
{
  "token": "your-api-token-here"
}

Token yn autorisaasjekop brûke

Authorization: Token your-api-token-here

Skerm

Beheare jo websidemonitors.

Blêders sjen litte

GET /api/v1/monitors/
Antwurd
[
  {
    "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"
  }
]

Monitor oanmeitsje

POST /api/v1/monitors/
Parameters
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

Monitor ophelje

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

Bywurkje Monitor

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

Monitor wiskje

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

Monitor skofje

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

Monitor werstelle

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

Monitorstatistyk ophelje

GET /api/v1/monitors/{id}/statistics/
Parameters
days Opsjoneel Oantal dagen om op te nimmen. Standert: 30

Foarfallen

Besykje de ynhâld fan de skiednis en de skiednis fan de stêd.

Foarfallen sjen litte

GET /api/v1/incidents/
Parameters
status Opsjoneel Filterje op tastân: yn wurkjen, oplost
monitor Opsjoneel Filterje op skerm- ID

Foarfal ophelje

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

Alert

Configure alert notifications for your monitors.

Alaarms listje

GET /api/v1/alerts/

Alaarm oanmeitsje

POST /api/v1/alerts/
Parameters
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)

Alaarm bywurkje

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

Alaarm wiskje

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

Tastânssiden

Publieke tastânssiden oanmeitsje en beheare.

Tastânssiden listje

GET /api/v1/status-pages/

Tastânside oanmeitsje

POST /api/v1/status-pages/
Parameters
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)

Teams

Beheare team tagong en gearwurking.

Teams sjen litte

GET /api/v1/teams/

Team oanmeitsje

POST /api/v1/teams/

Team ophelje

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

Koade foarbylden

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

Klaar om te begjinnen?

It is in keunstwurk en wurdt brûkt om de stêd te ferljochtsjen.

Registrearje fergees API- token ophelje