Authentifizierung
Alle API-Anfragen erfordern zwei HTTP-Header:
X-API-Key: <Ihr API Key>
X-API-Secret: <Ihr Secret>
Basis-URL
https://ihre-domain.de/api.php
Verfuegbare Endpoints
Zeiteintraege abrufen
POST /api.php
Content-Type: application/json
{
"action": "external_getTimeEntries",
"projectId": "optional - Projekt-ID",
"clientId": "optional - Kunden-ID",
"userId": "optional - Benutzer-ID",
"dateFrom": "2024-01-01",
"dateTo": "2024-12-31",
"billed": false,
"page": 1,
"perPage": 100
}
Projekte abrufen
POST /api.php
Content-Type: application/json
{
"action": "external_getProjects"
}
Kunden abrufen
POST /api.php
Content-Type: application/json
{
"action": "external_getClients"
}
Beispiel mit cURL
curl -X POST https://ihre-domain.de/api.php \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-API-Secret: YOUR_API_SECRET" \
-d '{"action": "external_getTimeEntries", "dateFrom": "2024-01-01"}'
Antwortformat
{
"success": true,
"data": {
"entries": [
{
"id": "...",
"projectId": "...",
"projectName": "Projektname",
"clientName": "Kundenname",
"date": "2024-01-15",
"duration": 120,
"description": "Beschreibung",
"billed": false
}
],
"pagination": {
"currentPage": 1,
"totalPages": 5,
"totalEntries": 48,
"perPage": 100
}
}
}
Fehlercodes
- 401 Unauthorized - Fehlende oder ungueltige API-Credentials
- 400 Bad Request - Ungueltige Parameter