REST API Reference v2.0.0

File Manager Pro API

Vollständige Schnittstelle für Server-Skripte, Drittanwendungen, Backups und externe Tools.

Authentifizierung

Senden Sie Ihren API-Token als Bearer-Token im Authorization-Header oder als Parameter ?api_token=...

Authorization: Bearer fm_live_••••••••

Dateisystem

GET /api.php?action=list
action=list

Listet Ordnerinhalte mit Metadaten (Größe, Typ, mtime, Rechte) auf.

Parameter

Feld Typ Status Beschreibung
path string Optional Relativer Verzeichnispfad (Standard: Stammverzeichnis)
show_hidden bool Optional Versteckte Dotfiles (.env, .git) anzeigen
Beispiel cURL
curl -H "Authorization: Bearer fm_live_..." "https://fm.docotec.de/api.php?action=list&path=src"
POST /api.php?action=create
action=create

Erstellt eine neue leere Datei oder einen neuen Ordner.

Parameter

Feld Typ Status Beschreibung
target_dir string Optional Zielordner
name string Pflicht Name des Elements
type string Pflicht 'file' oder 'folder'
Beispiel cURL
curl -X POST -H "Authorization: Bearer fm_live_..." -H "Content-Type: application/json" -d '{"target_dir":"","name":"neu.txt","type":"file"}' "https://fm.docotec.de/api.php?action=create"
GET /api.php?action=read_content
action=read_content

Liest den Dateiinhalt einer Code- oder Textdatei aus.

Parameter

Feld Typ Status Beschreibung
path string Pflicht Relativer Dateipfad
Beispiel cURL
curl -H "Authorization: Bearer fm_live_..." "https://fm.docotec.de/api.php?action=read_content&path=config.php"
POST /api.php?action=write_content
action=write_content

Speichert Dateiinhalt und erzeugt automatisch einen SQLite-Versionssnapshot.

Parameter

Feld Typ Status Beschreibung
path string Pflicht Relativer Dateipfad
content string Pflicht Neuer Dateiinhalt
summary string Optional Beschreibung der Änderung
Beispiel cURL
curl -X POST -H "Authorization: Bearer fm_live_..." -H "Content-Type: application/json" -d '{"path":"script.js","content":"console.log('v2');","summary":"Update via API"}' "https://fm.docotec.de/api.php?action=write_content"

Historie & Versionen

GET /api.php?action=history_list
action=history_list

Gibt alle gespeicherten Snapshots einer Datei chronologisch zurück.

Parameter

Feld Typ Status Beschreibung
path string Pflicht Dateipfad
Beispiel cURL
curl -H "Authorization: Bearer fm_live_..." "https://fm.docotec.de/api.php?action=history_list&path=script.js"
POST /api.php?action=history_rollback
action=history_rollback

Setzt eine Datei auf einen früheren Snapshot-Stand zurück.

Parameter

Feld Typ Status Beschreibung
snapshot_id integer Pflicht ID des Ziel-Snapshots
Beispiel cURL
curl -X POST -H "Authorization: Bearer fm_live_..." -H "Content-Type: application/json" -d '{"snapshot_id":42}' "https://fm.docotec.de/api.php?action=history_rollback"

Transfers & Downloads

POST /api.php?action=remote_download
action=remote_download

Startet den direkten Download einer Web-URL auf den Server.

Parameter

Feld Typ Status Beschreibung
url string Pflicht Web-URL (HTTP/HTTPS)
target_dir string Optional Zielordner
filename string Optional Optionaler Wunsch-Dateiname
Beispiel cURL
curl -X POST -H "Authorization: Bearer fm_live_..." -H "Content-Type: application/json" -d '{"url":"https://example.com/file.zip","target_dir":""}' "https://fm.docotec.de/api.php?action=remote_download"

Suche & Tools

POST /api.php?action=search_content
action=search_content

Rekursive Volltext-Inhaltssuche in Text- und Code-Dateien mit Regex.

Parameter

Feld Typ Status Beschreibung
query string Pflicht Suchbegriff oder Regex
path string Optional Startverzeichnis
is_regex bool Optional Als regulären Ausdruck ausführen
case_sensitive bool Optional Groß-/Kleinschreibung beachten
Beispiel cURL
curl -X POST -H "Authorization: Bearer fm_live_..." -H "Content-Type: application/json" -d '{"query":"function Database","path":""}' "https://fm.docotec.de/api.php?action=search_content"

System & Diagnose

GET /api.php?action=system_info
action=system_info

Gibt Server-Metriken, installierte CLI-Tools (ffmpeg, yt-dlp, 7z) und PHP-Limits zurück.

Beispiel cURL
curl -H "Authorization: Bearer fm_live_..." "https://fm.docotec.de/api.php?action=system_info"

Web Terminal

GET /api.php?action=terminal_status
action=terminal_status

Prüft, ob die Web-Terminal-Sitzung entsperrt ist, und liefert Prompt und Arbeitsverzeichnis.

Beispiel cURL
curl "https://fm.docotec.de/api.php?action=terminal_status"
POST /api.php?action=terminal_login
action=terminal_login

Authentifiziert die Web-Terminal-Sitzung mit dem Admin-Passwort.

Parameter

Feld Typ Status Beschreibung
password string Pflicht Admin-Passwort
Beispiel cURL
curl -X POST -H "Content-Type: application/json" -d '{"password":"..."}' "https://fm.docotec.de/api.php?action=terminal_login"
POST /api.php?action=terminal_exec
action=terminal_exec

Führt einen Shell-Befehl (z.B. git, composer, ls) in der authentifizierten Terminal-Sitzung aus.

Parameter

Feld Typ Status Beschreibung
command string Pflicht Shell-Befehl
Beispiel cURL
curl -X POST -H "Content-Type: application/json" -d '{"command":"ls -la"}' "https://fm.docotec.de/api.php?action=terminal_exec"
GET /api.php?action=terminal_logout
action=terminal_logout

Beendet und sperrt die aktive Web-Terminal-Sitzung.

Beispiel cURL
curl "https://fm.docotec.de/api.php?action=terminal_logout"