API Dokumentation
REST API v1.0.0 für Website, Mobile App und externe Clients.
Einführung
Die xCasaTV API ist eine JSON-REST-Schnittstelle für mobile Apps, Integrationen und die Website. Alle Antworten sind UTF-8-kodiert. Authentifizierte Anfragen nutzen Bearer-Tokens mit 30 Tagen Gültigkeit.
Basis-URL
https://xcasatv.de/api/v1/
Beispiel: https://xcasatv.de/api/v1/news
Authentifizierung
Nach POST /auth/login oder /auth/register erhältst du ein Token:
Authorization: Bearer <selector>:<validator>
Login-Beispiel:
POST https://xcasatv.de/api/v1/auth/login
Content-Type: application/json
X-Device-Id: abc123...
{
"username": "deinuser",
"password": "deinpasswort",
"client_name": "android-app"
}
Token erneuern: POST /auth/refresh · Abmelden: POST /auth/logout
Header
| Header | Pflicht | Beschreibung |
|---|---|---|
Content-Type |
Bei POST | application/json |
Authorization |
Bei geschützten Routen | Bearer selector:validator |
X-Device-Id |
Empfohlen | 64-stellige Geräte-ID (Ban-Schutz & Sicherheit) |
X-Client-Name |
Optional | z. B. android-app, ios-app, website |
Antwortformat
Erfolg:
{ "success": true, ... }
Fehler:
{
"success": false,
"error": "validation_error",
"message": "Beschreibung auf Deutsch"
}
Fehlercodes
| Code | HTTP | Bedeutung |
|---|---|---|
unauthorized |
401 | Nicht eingeloggt oder ungültiger Token |
invalid_credentials |
401 | Falscher Benutzername oder Passwort |
forbidden |
403 | Keine Berechtigung für diese Ressource |
account_banned |
403 | Account gesperrt |
pending_verification |
403 | Ausweis-Verifizierung erforderlich |
access_denied |
403 | IP oder Gerät gesperrt |
not_found |
404 | Ressource nicht gefunden |
conflict |
409 | Konflikt (z. B. Benutzername vergeben) |
validation_error |
422 | Ungültige Eingabedaten |
rate_limited |
429 | Zu viele Anfragen |
maintenance_mode |
503 | Wartungsmodus aktiv |
server_error |
500 | Interner Serverfehler |
System
/
Öffentlich
API-Info und Endpunktliste
https://xcasatv.de/api/v1/
Antwort (Beispiel)
{ "success": true, "api": "xCasaTV API", "version": "1.0.0", "endpoints": [...] }
/health
Öffentlich
Health-Check (Datenbank, Status)
https://xcasatv.de/api/v1/health
Antwort (Beispiel)
{ "success": true, "status": "ok", "timestamp": "...", "database": "connected" }
/config
Öffentlich
Öffentliche Site- & App-Konfiguration
https://xcasatv.de/api/v1/config
Antwort (Beispiel)
{ "success": true, "site": {...}, "app": {...}, "api": {...} }
Authentifizierung
/auth/login
Öffentlich
Login — liefert Bearer-Token
https://xcasatv.de/api/v1/auth/login
Request Body
{"username":"user","password":"***","client_name":"android-app"}
Antwort (Beispiel)
{ "success": true, "user": {...}, "token": { "access_token": "...", "expires_in": 2592000 } }
/auth/register
Öffentlich
Registrierung + Token
https://xcasatv.de/api/v1/auth/register
Request Body
{"username":"user","email":"a@b.de","password":"***","client_name":"ios-app"}
Antwort (Beispiel)
{ "success": true, "user": {...}, "token": {...} }
/auth/logout
Auth
Token widerrufen
https://xcasatv.de/api/v1/auth/logout
Antwort (Beispiel)
{ "success": true, "message": "Erfolgreich abgemeldet." }
/auth/refresh
Auth
Token erneuern (alter Token wird ungültig)
https://xcasatv.de/api/v1/auth/refresh
Antwort (Beispiel)
{ "success": true, "user": {...}, "token": {...} }
/auth/me
Auth
Aktueller Benutzer
https://xcasatv.de/api/v1/auth/me
Antwort (Beispiel)
{ "success": true, "user": { "id", "username", "email", "role", "status", ... } }
Inhalte
/news
Öffentlich
Alle News
https://xcasatv.de/api/v1/news
Antwort (Beispiel)
{ "success": true, "news": [...] }
/news/{id}
Öffentlich
Einzelne News
https://xcasatv.de/api/v1/news/{id}
Antwort (Beispiel)
{ "success": true, "news": {...} }
/tutorials
Öffentlich
Tutorials (?category=TeamSpeak)
https://xcasatv.de/api/v1/tutorials
Antwort (Beispiel)
{ "success": true, "tutorials": [...] }
/tutorials/{id}
Öffentlich
Einzelnes Tutorial
https://xcasatv.de/api/v1/tutorials/{id}
Antwort (Beispiel)
{ "success": true, "tutorial": {...} }
/videos
Öffentlich
Video-Liste
https://xcasatv.de/api/v1/videos
Antwort (Beispiel)
{ "success": true, "videos": [...] }
/videos/{id}
Öffentlich
Einzelnes Video
https://xcasatv.de/api/v1/videos/{id}
Antwort (Beispiel)
{ "success": true, "video": {...} }
/projects
Öffentlich
Projekte
https://xcasatv.de/api/v1/projects
Antwort (Beispiel)
{ "success": true, "projects": [...] }
/scripts
Öffentlich
Skript-Katalog
https://xcasatv.de/api/v1/scripts
Antwort (Beispiel)
{ "success": true, "scripts": [...] }
Shop
/shop/products
Öffentlich
Alle Shop-Produkte
https://xcasatv.de/api/v1/shop/products
Antwort (Beispiel)
{ "success": true, "products": [...] }
Forum
/forum/categories
Öffentlich
Kategorien mit Statistik
https://xcasatv.de/api/v1/forum/categories
Antwort (Beispiel)
{ "success": true, "categories": [...] }
/forum/categories/{id}/threads
Öffentlich
Themen einer Kategorie
https://xcasatv.de/api/v1/forum/categories/{id}/threads
Antwort (Beispiel)
{ "success": true, "category": {...}, "threads": [...] }
/forum/threads/{id}
Öffentlich
Thema inkl. Beiträge
https://xcasatv.de/api/v1/forum/threads/{id}
Antwort (Beispiel)
{ "success": true, "thread": {...}, "posts": [...] }
/forum/threads
Auth
Neues Thema erstellen
https://xcasatv.de/api/v1/forum/threads
Request Body
{"category_id":1,"title":"...","content":"..."}
Antwort (Beispiel)
{ "success": true, "thread_id": 12, "url": "..." }
/forum/threads/{id}/posts
Auth
Antwort schreiben
https://xcasatv.de/api/v1/forum/threads/{id}/posts
Request Body
{"content":"..."}
Antwort (Beispiel)
{ "success": true, "post_id": 45 }
Support-Tickets
/tickets
Auth
Eigene Tickets
https://xcasatv.de/api/v1/tickets
Antwort (Beispiel)
{ "success": true, "tickets": [...] }
/tickets
Auth
Ticket erstellen
https://xcasatv.de/api/v1/tickets
Request Body
{"subject":"...","message":"...","priority":"medium"}
Antwort (Beispiel)
{ "success": true, "ticket_id": 7, "url": "..." }
/tickets/{id}
Auth
Ticket inkl. Nachrichten
https://xcasatv.de/api/v1/tickets/{id}
Antwort (Beispiel)
{ "success": true, "ticket": {...}, "messages": [...] }
/tickets/{id}/messages
Auth
Antwort senden
https://xcasatv.de/api/v1/tickets/{id}/messages
Request Body
{"message":"..."}
Antwort (Beispiel)
{ "success": true, "message": "Antwort gesendet." }
/tickets/{id}/close
Auth
Ticket schließen
https://xcasatv.de/api/v1/tickets/{id}/close
Antwort (Beispiel)
{ "success": true, "message": "Ticket wurde geschlossen." }
Konto
/orders
Auth
Eigene Bestellungen
https://xcasatv.de/api/v1/orders
Antwort (Beispiel)
{ "success": true, "orders": [...] }
/downloads
Auth
Gekaufte Skripte & Produktdateien
https://xcasatv.de/api/v1/downloads
Antwort (Beispiel)
{ "success": true, "scripts": [...], "products": [...] }
Beispiel: App-Start
// 1. Konfiguration laden
GET https://xcasatv.de/api/v1/config
// 2. Login
POST https://xcasatv.de/api/v1/auth/login
Headers: Content-Type, X-Device-Id
Body: { username, password, client_name: "android-app" }
// 3. Token speichern → access_token
// 4. Inhalte laden
GET https://xcasatv.de/api/v1/news
GET https://xcasatv.de/api/v1/tutorials
Headers: Authorization: Bearer <token>
// 5. Eingeloggt: Tickets & Downloads
GET https://xcasatv.de/api/v1/tickets
GET https://xcasatv.de/api/v1/downloads
Headers: Authorization, X-Device-Id