API Documentation

Kuphatikiza EstaCaido ndi zofunikira zanu

Kuyamba

The EstaCaido API amalola kuyendetsa wanu ma monitors, kuona zifukwa, kukhazikitsa uthenga ndi zambiri kuchokera wanu code.All API endpoints kugwiritsa ntchito JSON kwa zosowa ndi yankho ziwalo.

Base URL

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

Kusinthanitsa

M'malo mwake, API tokens akhoza kubweretsa 100 zopempha pa mphindi. Mafunso m'munsimu kuti malire apeza 429 Too Many Requests yankho.

Kutsimikizira

Kugwiritsa ntchito token-based kutsimikizika kwa onse API zosowa. Kuphatikizapo token yanu mu Authorization header.

Kupeza Token Yotsimikizika

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

Use the token in the Authorization header

Authorization: Token your-api-token-here

Ma Monitors

Kuwongolera ma monitors anu a webusaiti.

Limbikitsani

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

Pangani Monitor

POST /api/v1/monitors/
Ma parameters
name Zofunika Kusintha kwa ma monitor
domain Zofunika Domain yoyang'anira, monga example.com
check_interval Chosafunikira Kuyesa nthawi ya mphindi, imodzi mwa 30, 60, 300, 600, 900, 1800, 3600. Kukhazikika: 300
check_type Chosafunikira Mmodzi mwa matanthauzo awa: http, https, ping. Cholakwika: https

Kupeza Monitor

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

Kusintha Monitor

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

Kuchotsa Monitor

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

Kuletsa Monitor

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

Kubwezeretsa Monitor

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

Pezani Monitor Statistics

GET /api/v1/monitors/{id}/statistics/
Ma parameters
days Chosafunikira Mtengo wa masiku kuti aphatikizidwe. Default: 30

Zochitika

View downtime zifukwa ndi mbiri yawo.

Kulemba

GET /api/v1/incidents/
Ma parameters
status Chosafunikira Chotsani ndi khalidwe: akuchitika, anatha
monitor Chosafunikira Chotsani

Kupeza

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

Zidziwitso

Kusintha kwa ma alerts kwa ma monitors anu.

Kulemba

GET /api/v1/alerts/

Kukhazikitsa

POST /api/v1/alerts/
Ma parameters
monitor Zofunika Monitor ID
alert_type Zofunika Mmodzi wa matanthauzo awa: email, sms, slack, discord, webhook, pagerduty, teams
recipients Zofunika Kutumiza
alert_on_down Chosafunikira Kudziwitsa pamene malo achoka (zosasinthika: true)
alert_on_recovery Chosafunikira Kudziwitsa pamene malowa akubwezeretsedwa (zosasinthika: zoona)

Kusintha

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

Ku_chotsa

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

Masamba a Status

Kukhazikitsa ndi kusamalira anthu status masamba.

Kulemba Status Pages

GET /api/v1/status-pages/

Kukhazikitsa Page

POST /api/v1/status-pages/
Ma parameters
title Zofunika Mtundu wa tsamba
slug Zofunika URL slug (mwachitsanzo, my-status-page)
description Chosafunikira Kufotokozera
is_public Chosafunikira Kupangitsa kuti anthu azitha kulowa (zosasinthika: zoona)

Magulu

Kuwongolera kulumikizana ndi kulumikizana kwa timu.

Kulemba

GET /api/v1/teams/

Kukhazikitsa gulu

POST /api/v1/teams/

Kupeza Team

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

Kodi Misonkho

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

Mukusangalala ndi ntchitoyi?

Kulembetsa kwaulere ndikupeza API token yanu kuti muyambe kuphatikizira.

Lowani Kwaulere Pezani API Token