⚡ Kom igång
API:et använder enkla HTTP GET-anrop. Din personliga API-nyckel krävs för autentisering. Bas-URL enligt OpenAPI-specifikationen.
Base URL · Produktionsserver
https://
status.bitup.se
/api.php?key=
{API_KEY}
&action=
{action}
🔒 All kommunikation sker över TLS 1.3
Obligatoriska parametrar
| Parameter | Typ | Beskrivning |
|---|---|---|
| key | string | Din personliga API-nyckel required |
| action | enum | status incidents stats required |
📡 Endpoints
GET
/api.php
Query-parametrar
| Namn | Typ | Beskrivning |
|---|---|---|
| key * | string | Din personliga API-nyckel |
| action * | enum | status, incidents, eller stats |
Response codes
200 · Success
401 · Unauthorized
400 · Bad Request
GET
action=status
Hämtar realtidsstatus för alla aktiva monitorer.
// Response 200 - Array av Monitor-objekt
{
"status": "success",
"api_version": "2.0",
"data": [
{
"id": "1",
"name": "Web Server 01",
"type": "http",
"target": "status.bitup.se",
"port": "443",
"status": "up", // Enum: up, down, maintenance
"last_check": "2026-02-13 14:30:00"
}
]
}
📋 Monitor-schema
| Fält | Typ | Enum |
|---|---|---|
| id | string | - |
| name | string | - |
| type | string | - |
| target | string | - |
| port | string | - |
| status | string | up down maintenance |
| last_check | date-time | - |
GET
action=incidents
Returnerar incidenter med tillhörande uppdateringar.
{
"status": "success",
"api_version": "2.0",
"data": [
{
"id": "45",
"title": "Nätverksfördröjning SE-STHLM",
"description": "Hög latens mot vår peer i Stockholm",
"is_active": "1",
"created_at": "2026-02-13 10:00:00",
"updates": [
{
"message": "Vi undersöker problemet",
"created_at": "2026-02-13 10:30:00"
}
]
}
]
}
GET
action=stats
Systemstatistik - totala monitorer, online/offline och uptime.
{
"status": "success",
"api_version": "2.0",
"data": {
"total": 10,
"online": 9,
"offline": 1,
"uptime_percent": 98.7
}
}
📋 Schemas
ApiResponse
| Fält | Typ | Beskrivning |
|---|---|---|
| status | string | "success" eller "error" |
| api_version | string | "2.0" |
| data | array/object | Monitor[], Incident[] eller Stats |
Stats
| Fält | Typ |
|---|---|
| total | integer |
| online | integer |
| offline | integer |
| uptime_percent | number |
⚠️ Error Responses
401
Unauthorized
Nyckel saknas eller är felaktig
{
"status": "error",
"message": "Invalid API key. Access denied."
}
400
Bad Request
Ogiltig action-parameter
{
"status": "error",
"message": "Invalid action parameter"
}
📋 ErrorResponse-schema
| Fält | Typ | Exempel |
|---|---|---|
| status | string | "error" |
| message | string | "Invalid API key. Access denied." |
⚡ Testa API:et
# Hämta status för alla monitorer
curl -X GET "https://status.bitup.se/api.php?key={DIN NYCKEL}&action=status"
curl -X GET "https://status.bitup.se/api.php?key={DIN NYCKEL}&action=status"
# Hämta incidenter
curl -X GET "https://status.bitup.se/api.php?key={DIN NYCKEL}&action=incidents"
curl -X GET "https://status.bitup.se/api.php?key={DIN NYCKEL}&action=incidents"
# Hämta statistik
curl -X GET "https://status.bitup.se/api.php?key={DIN NYCKEL}&action=stats"
curl -X GET "https://status.bitup.se/api.php?key={DIN NYCKEL}&action=stats"
OpenAPI 3.0.0 · Fullt dokumenterad enligt specifikation