Was es kann
Warum es Ihnen hilft
https://frontend.local/api
Authorization: Bearer
Verb & Path | Purpose | Success | Common errors |
---|---|---|---|
GET /reports/{id} | Fetch the full JSON payload for one report. | 200 →{ data: {…} } | 401 Unauthenticated, 404 Not found |
GET /reports?page=1&per_page=25 | List reports (paginated). | 200 → { data: [ … ], meta: { page, per_page, total } } | 401 Unauthenticated |
Alle anderen Pfade erben den Sicherheitsmechanismus BearerAuth
, wie in der OpenAPI 3.1-Spezifikation definiert (siehe components.securitySchemes.BearerAuth
).
{
"data": {
"id": "abc123",
"title": "NorthPoly P5508",
"created_at": "2025-07-09T08:15:30Z",
"data": { /* arbitrary nested KPI structure */ }
}
}
"meta": {
"page": 2,
"per_page": 25,
"total": 100
}
ReportTransformer
(Ausschnitt)
Field | Type | Notes |
---|---|---|
id | string | Primary key |
title | string | Human-readable title |
created_at | string (data-time) | ISO-8601 |
data | object | Your custom metrics |
Status | Body |
---|---|
401 | {"message":"Unauthenticated"} |
404 | {"error":{"code":"not_found","message":"Report not found"}} |
Validation | { "message": "Validation error", "errors": { field: ["msg"] } } |
Shell (cURL)
curl -X GET "https://frontend.local/api/reports?page=2&per_page=10" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json"
JavaScript (Fetch)
const res = await fetch("https://frontend.local/api/reports/abc123", {
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json",
},
});
if (!res.ok) throw new Error(res.statusText);
const { data } = await res.json();