AddOn/Fehlzeitenimport/index.php hinzugefügt
This commit is contained in:
parent
ca7857b5f4
commit
a174811260
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
include('TimeTrackingAPI.php');
|
||||
|
||||
$api = new TimeTrackingAPI(
|
||||
'https://mytimeserver.de', // Base-URL
|
||||
'Bearer eyJhbGciOi...', // Dein Bearer-Token
|
||||
'timesvc' // API-Site
|
||||
);
|
||||
|
||||
// 1. Verfügbare Exporte abrufen
|
||||
$exports = $api->getExportDefinitions();
|
||||
|
||||
// 2. Organisationseinheiten abrufen
|
||||
$units = $api->getOrganizationUnits();
|
||||
|
||||
// 3. Export starten
|
||||
$guid = $api->requestExport(
|
||||
'<ExportDefinitionId>',
|
||||
'<OrganizationUnitId>',
|
||||
'01.01.2024',
|
||||
'31.01.2024'
|
||||
);
|
||||
|
||||
// 4. Exportdaten abrufen
|
||||
$data = $api->getExportData($guid);
|
||||
|
||||
// Ergebnis prüfen
|
||||
if (isset($data['Result']) && $data['Result'] === 'JobPending') {
|
||||
echo "Export läuft noch. Bitte später erneut versuchen.";
|
||||
} else {
|
||||
print_r($data); // Daten vorhanden
|
||||
}
|
||||
Loading…
Reference in New Issue