kimai/api-php

Swagger generated API stubs for Kimai

2.0 2025-01-21 23:34 UTC

This package is auto-updated.

Last update: 2025-01-21 23:36:46 UTC


README

JSON API for the Kimai time-tracking software: API documentation

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.0 (for Kimai > 2.28.0)

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer:

composer require kimai/api-php

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | Absence ID to delete

try {
    $apiInstance->deleteDeleteAbsence($id);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->deleteDeleteAbsence: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | Publi holiday ID to delete

try {
    $apiInstance->deleteDeletePublicHoliday($id);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->deleteDeletePublicHoliday: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | Public holiday group ID to delete

try {
    $apiInstance->deleteDeletePublicHolidayGroup($id);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->deleteDeletePublicHolidayGroup: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$user = "user_example"; // string | User ID to filter absences. Needs permission 'contract_other_profile' (default: current user)
$begin = "begin_example"; // string | Only absences after this date will be included (format: HTML5)
$end = "end_example"; // string | Only absences before this date will be included (format: HTML5)

try {
    $result = $apiInstance->getGetAbsences($user, $begin, $end);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->getGetAbsences: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$user = "user_example"; // string | User ID to filter absences. Needs permission 'contract_other_profile' (default: current user)
$begin = "begin_example"; // string | Only absences after this date will be included (format: HTML5)
$end = "end_example"; // string | Only absences before this date will be included (format: HTML5)
$language = "language_example"; // string | The language to be used for displaying the absences (format: en or en_GB)

try {
    $result = $apiInstance->getGetAbsencesCalendar($user, $begin, $end, $language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->getGetAbsencesCalendar: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group = "group_example"; // string | Public holiday - group ID to filter. (default: default group)
$begin = "begin_example"; // string | Only absences after this date will be included (format: HTML5)
$end = "end_example"; // string | Only absences before this date will be included (format: HTML5)

try {
    $result = $apiInstance->getGetPublicHolidays($group, $begin, $end);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->getGetPublicHolidays: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group = "group_example"; // string | Public holiday - group ID to filter. (default: default group)
$begin = "begin_example"; // string | Only absences after this date will be included (format: HTML5)
$end = "end_example"; // string | Only absences before this date will be included (format: HTML5)

try {
    $result = $apiInstance->getGetPublicHolidaysCalendar($group, $begin, $end);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->getGetPublicHolidaysCalendar: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$language = "language_example"; // string | The language to be used for displaying the absences types (format: de or en_GB)

try {
    $result = $apiInstance->getKimaipluginWorkcontractApiAbsenceGetabsencetypes($language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->getKimaipluginWorkcontractApiAbsenceGetabsencetypes: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | Absence ID

try {
    $result = $apiInstance->patchConfirmApprovalAbsence($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->patchConfirmApprovalAbsence: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | Absence ID

try {
    $result = $apiInstance->patchRejectApprovalAbsence($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->patchRejectApprovalAbsence: ', $e->getMessage(), PHP_EOL;
}


$apiInstance = new Swagger\Client\Api\AbsenceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = "id_example"; // string | Absence ID

try {
    $result = $apiInstance->patchRequestApprovalAbsence($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsenceApi->patchRequestApprovalAbsence: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to /

Documentation For Models

Documentation For Authorization

bearer

  • Type: HTTP bearer authentication

Author