API စာရွက်စာတမ်းများ

သင်၏ application များနှင့်အတူ EstaCaido ပေါင်းစည်း

စတင်ခြင်း

အဆိုပါ EstaCaido API ကိုသင်သည်သင်၏မော်နီတာစီမံခန့်ခွဲနိုင်ပါတယ်, အဖြစ်အပျက်များကိုကြည့်ရှု, သင့်ကိုယ်ပိုင် code ကိုမှသတိပေးချက်များနှင့်ပိုပြီး configurate. အားလုံး API endpoints request နှင့်တုံ့ပြန်မှုကိုယ်ခန္ဓာများအတွက် JSON ကိုအသုံးပြု.

အခြေခံ URL

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

အမြန်နှုန်း ကနိမ့်ဆုံး

တစ်ခုချင်းစီကို API ကို token ကိုမိနစ်လျှင် 100 တောင်းဆိုမှုများကိုအထိလုပ်နိုင်သည်။ ဤအကနိမ့်ထက်တောင်းဆိုချက်များတစ်ဦး 429 Too Many Requests တုံ့ပြန်မှုရ.

အသိအမှတ်ပြုခြင်း

အားလုံး API ကိုတောင်းဆိုချက်များအတွက် token-based အတည်ပြုအသုံးပြုပါ။ Authorization header မှာသင့်ရဲ့ token ကိုထည့်သွင်းပါ။

အတည်ပြုချက် တန်ကိန်းကို ရယူပါ

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: Token your-api-token-here

မျက်နှာပြင်များ

သင်၏ website ကိုစောင့်ကြည့်ဖို့စီမံခန့်ခွဲ။

ကြည့်ရှုသူစာရင်း

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

Monitor ဖန်တီးပါ။

POST /api/v1/monitors/
သတ်မှတ်ချက်များ
name လိုအပ်သည် မျက်နှာပြင်အမည်
domain လိုအပ်သည် စောင့်ကြည့်ဖို့ 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

အဖြစ်အပျက်များ

downtime အဖြစ်အပျက်များနှင့်၎င်းတို့၏သမိုင်းကိုကြည့်ရှုပါ။

အဖြစ်အပျက်များစာရင်း

GET /api/v1/incidents/
သတ်မှတ်ချက်များ
status ရွေးချယ်စရာ အခြေအနေအရ စစ်ဆေးပါ: လုပ်ဆောင်နေသည်, ဖြေရှင်း
monitor ရွေးချယ်စရာ မျက်နှာပြင် အမည်ဖြင့် စစ်ထုတ်

အဖြစ်အပျက်ကိုရယူပါ

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

သတိပေးချက်များ

သင်၏မော်နီတာများအတွက်သတိပေးချက် အသိပေးချက်များကို configure လုပ်ပါ

သတိပေးချက်များ စာရင်းပြုစု

GET /api/v1/alerts/

သတိပေးချက် ပြုလုပ်

POST /api/v1/alerts/
သတ်မှတ်ချက်များ
monitor လိုအပ်သည် မျက်နှာပြင် အမည်
alert_type လိုအပ်သည် ဤတန်ဖိုးများထဲကတစ်ခု: email, sms, slack, discord, webhook, pagerduty, teams
recipients လိုအပ်သည် ရရှိသူ လိပ်စာများ သို့မဟုတ် webhook URLs
alert_on_down ရွေးချယ်စရာ နေရာကျဆင်းသွားလျှင် အသိပေး (စံ: အမှန်)
alert_on_recovery ရွေးချယ်စရာ နေရာပြန်လည်ရရှိလာတဲ့အခါအသိပေး (စံ: အမှန်)

သတိပေးချက်ကို ပြန်လည်ဆန်းစစ်ပါ

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

သတိပေးချက်ကို ဖျက်ပါ

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 ကိုရယူပါ