API Dokumentasie

Integrate EstaCaido with your applications

Hoe om te begin

The EstaCaido API lets you manage your monitors, view incidents, configure alerts and more from your own code. All API endpoints use JSON for request and response bodies.

Basis URL

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

Herhaal:

Elke API-bewys kan vergoed vir 100 versoeke per minuut. Versoeke oor daardie beperking kry 'n 429 Too Many Requests antwoord.

Verifiëring het gefaal

Gebruik bewys- based geldigheidsverklaring vir alle API versoeke. Sluit jou sein in die magtigingstitel.

Kry verifiërings-toets

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

Gebruik die teken in die magtigingstitel

Authorization: Token your-api-token-here

Monitors

Bestuur pos, monitors

Lysmonitors

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

Skep monitor

POST /api/v1/monitors/
Parameters
name Benodig Naam vir die monitor
domain Benodig Domein om te monitor, byvoorbeeld example.com
check_interval Opsionele Kyk interval in sekondes, een van 30, 60, 300, 600, 900, 1800, 3600. Verstek: 300
check_type Opsionele Een van hierdie waardes: http, https, ping. Verstek: https

Kry Monitor

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

Dateer op Monitor

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

Skrap skerm

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

Stop tydelik Monitor

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

Voortgaan Monitor

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

Kry Monitorstatistiek

GET /api/v1/monitors/{id}/statistics/
Parameters
days Opsionele Aantal dae om in te sluit. Verstek: 30

Voorvalle

Beskou voorvalle in die verlede en hulle geskiedenis.

Lysse

GET /api/v1/incidents/
Parameters
status Opsionele Filter deur status: gaan voort, opgelos
monitor Opsionele Filter deur monitor Id

Raak onaanpasbaar

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

WaarskuwingsSound event

Stel waarskuwinginligting vir jou monitors op.

Waarskuwings:

GET /api/v1/alerts/

Skep Waarskuwing

POST /api/v1/alerts/
Parameters
monitor Benodig Monitor-ID
alert_type Benodig One of these values: email, sms, slack, discord, webhook, pagerduty, teams
recipients Benodig Ontvanger adresse of webook Urls
alert_on_down Opsionele Stel kennis wanneer die webwerf daal (verstek: waar)
alert_on_recovery Opsionele Stel kennis wanneer ruimte herstel (verstek: Waar)

Dateer op Waarskuwing

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

Skrap

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

Status bladsye

Skep en bestuur openbare statusbladsye.

Lys status bladsye

GET /api/v1/status-pages/

Skep Werkvoorbeeld

POST /api/v1/status-pages/
Parameters
title Benodig Titel vir die statusblad
slug Benodig URL slug (bv. my-status-bladsy)
description Opsionele Beskrywing teks
is_public Opsionele Maak in die openbaar toeganklik (verstek: waar)

Spanne

Bestuur spantoegang en samewerking.

Lysspanne

GET /api/v1/teams/

Skep Werkvoorbeeld

POST /api/v1/teams/

Kry Span

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

Kommentaar Voorbeelde

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

Gereed om te begin?

Teken gratis op en kry jou API - teken om te begin inskakel.

Registreer Gratis Kry 'nPI-toon