API փաստաթղթավորում

Ինտեգրել EstaCaido-ը ձեր ծրագրերի հետ

Առաջարկում

EstaCaido API-ն թույլ է տալիս ձեզ կառավարել ձեր տեսախցիկները, դիտել պատահարները, կիրառել զգուշացումները և այլն ձեր սեփական կոդից։ API-ի բոլոր վերջնական կետերը օգտագործում են JSON-ը խնդրանքների և պատասխանների մարմինների համար։

Բնական URL

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

Օր

Յուրաքանչյուր API token-ը կարող է րոպեական 100 խնդրանքներ կատարել։ Այս սահմանից ավելի բարձր պահանջները ստանում են 429 Too Many Requests պատասխան։

Ավտոմատացում

Օգտագործել token- ի վրա հիմնված աուդիտացիան բոլոր API խնդրանքների համար։ Ավելացրեք ձեր token- ը Authorization գլխամասում։

Ավտոմատացված

POST /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 գլխամասում

Authorization: Token your-api-token-here

Մոնիտորներ

Կառավարեք ձեր կայքի մոնիտորները։

Տեղադրել մոնուրը

GET /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"
  }
]

Ստեղծել մոնիտոր

POST /api/v1/monitors/
Փարատոմսեր
name Պահանջվում է Մոնիտորի անուն
domain Պահանջվում է Դոմենի վերահսկողությունը, օրինակ example.com
check_interval Ընտրանքային Ստուգման ընթացքը վայրկյաններով, 30, 60, 300, 600, 900, 1800, 3600-ից մեկը: Լռելյայն՝ 300
check_type Ընտրանքային Ահա այս արժեքներից մեկը: http, https, ping. Լռելյայն: https

Գրանցվել

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

Ավելացնել նորացում

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

Հեռացնել տեսախցիկը

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

Ցուցադրել ցուցակը

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

Հաշվի առնել

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

Ստացել տեսախցիկի վիճակագրությունը

GET /api/v1/monitors/{id}/statistics/
Փարատոմսեր
days Ընտրանքային Օրերի թիվը ներառելու համար: Լռելյայն: 30

Ընդհանուր

Դիտեք անջատումների դեպքերը և դրանց պատմությունը։

Տեղեկություն էջի մասին

GET /api/v1/incidents/
Փարատոմսեր
status Ընտրանքային Փոխանցում
monitor Ընտրանքային Փաթեթավորել ըստ տեսախցիկի ID

Ստացել

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

Զգուշացում

Կապել ձեր մոնոների զգուշացնող տեղեկատվությունը։

Ցուցադրել զգուշացումները

GET /api/v1/alerts/

Create Alert

POST /api/v1/alerts/
Փարատոմսեր
monitor Պահանջվում է Դիտողության ID
alert_type Պահանջվում է Ահա այս արժեքներից մեկը: email, sms, slack, discord, webhook, pagerduty, teams
recipients Պահանջվում է Առաջարկվող ընթացիկ ընթացիկ
alert_on_down Ընտրանքային Հաշվի առնել կայքի ջարդված լինելու դեպքում (լռելյայն՝ ճիշտ)
alert_on_recovery Ընտրանքային Հաշվի առնել կայքի վերականգնման ժամանակ (լռելյայն՝ ճիշտ)

Ավելացնել զգուշացում

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

Delete Alert

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

Տեսակ

Կերտել և կառավարել հանրային վիճակի էջեր։

Տեղեկություն էջերի մասին

GET /api/v1/status-pages/

Ընտրեք ընթացիկ էջը

POST /api/v1/status-pages/
Փարատոմսեր
title Պահանջվում է Տեսության էջի վերնագիր
slug Պահանջվում է URL slug (օրինակ, my-status-page)
description Ընտրանքային Օգտագործված տեքստը
is_public Ընտրանքային Օգտագործել հանրային (լավագույնը` ճիշտ)

Ընդհանուր

Կառավարել թիմի մուտքերը և համագործակցությունը։

Ցուցակ

GET /api/v1/teams/

Ընտրեք խումբ

POST /api/v1/teams/

Գործողություն

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

Կոդի օրինակներ

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

Պատրաստ եք սկսելու։

Գրանցվեք անվճար և ստանալ API token-ը ինտեգրման համար։

Գրանցվեք անվճար Ստացել API Token