ເອກະສານ API

ລວມເອົາ EstaCaido ກັບ​ໂປແກຼມ​ຂອງທ່ານ

ເລີ່ມ​ຕົ້ນ

API EstaCaido ອະນຸຍາດໃຫ້ທ່ານຈັດການຕິດຕາມຂອງທ່ານ, ເບິ່ງເຫດການ, ຕັ້ງຄ່າການແຈ້ງເຕືອນແລະຫຼາຍກ່ວາຈາກໂປຣແກຣມຂອງທ່ານເອງ. ຈຸດສຸດທ້າຍ API ທັງຫມົດໃຊ້ JSON ສຳ ລັບຄໍາຮ້ອງຂໍແລະຮ່າງກາຍຕອບ.

URL ພື້ນຖານ

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

ຈໍາກັດ​ອັດຕາ

API token ແຕ່ລະອັນສາມາດເຮັດໄດ້ເຖິງການຮ້ອງຂໍ 100 ຕໍ່ນາທີ. ຄໍາຮ້ອງຂໍທີ່ເກີນຂອບເຂດນັ້ນໄດ້ຮັບຄໍາຕອບ 429 Too Many Requests.

ການ​ផ្ទៀង​ផ្ទាត់​ຄວາມ​ຖືກຕ້ອງ

ໃຊ້​ການ​ຢັ້ງຢືນ​ທີ່​ອີງ​ໃສ່​ໂຕກອນ ສຳ​ລັບ​ການ​ຮ້ອງຂໍ API ທັງໝົດ. ລວມ​ໂຕກອນ​ຂອງທ່ານ​ໃນ​ຫົວ​ຂໍ້​ການ​ອະນຸຍາດ.

ເອົາ​ໂຕກັ່ນ​ການ​ផ្ទៀង​ສົ່ງ​ມາ​ໃຊ້

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

ຈໍ​ສະແດງ​ຜົນ

ຈັດການ​ການ​ຕິດຕາມ​ເວບໄຊທ໌​ຂອງທ່ານ

ລາຍ​ຊື່​ໂມ​ນີ

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 ຕ້ອງການ ໂດເມນ​ທີ່​ຈະ​ຕິດຕາມ​ເບິ່ງ, ຕົວຢ່າງ 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 ທາງເລືອກ ຕົວ​ກັ່ນຕອງ​ຕາມ​ຕົວ​ລະບຸ​ໂມງ

ຮັບ​ເຫດການ

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

ແຈ້ງເຕືອນ

Configure alert notifications for your monitors.

ລາຍ​ຊື່​ການ​ແຈ້ງ​ເຕືອນ

GET /api/v1/alerts/

ສ້າງ​ການ​ແຈ້ງ​ການ

POST /api/v1/alerts/
​ប៉ារ៉ាម៉ែត្រ
monitor ຕ້ອງການ លេខ​សម្គាល់​ម៉ូនីទ័រ
alert_type ຕ້ອງການ ຄ່າ​ໃດ​ໜຶ່ງ​ໃນ​ນີ້: email, sms, slack, discord, webhook, pagerduty, teams
recipients ຕ້ອງການ ທີ່ຢູ່​ຜູ້​ຮັບ ຫຼື URL webhook
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 (ຕົວຢ່າງ, ຫນ້າ​ສະຖານະ​ຂອງ​ຂ້ອຍ)
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