thampe/troi-sdk

Troi API Implementation in PHP

1.3.4 2024-03-16 12:01 UTC

This package is auto-updated.

Last update: 2024-04-16 12:08:32 UTC


README

This is the official API documentation of Troi.

Authentication

Troi offers basic auth for authentication.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0+.

Composer

To install the bindings via Composer, run the following:

composer require thampe/troi-sdk 

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

Getting Started

Please follow the installation procedure and then run the following:

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



// Configure HTTP basic authorization: basicAuth
$config = Troi\Configuration::getDefaultConfiguration()
              ->setHost('YOUR_HOST')
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_V2_TOKEN');


$apiInstance = new Troi\Api\AbsencesApi(
    // 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
);

try {
    $result = $apiInstance->absencesGet($start, $end, $employee_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsencesApi->absencesGet: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://demo.troi.software/api/v2/rest

Class Method HTTP request Description
AbsenceTypesApi absenceTypesGet GET /absenceTypes Fetch all absence types
AbsenceTypesApi absenceTypesIdGet GET /absenceTypes/{id} Fetch Absence Type for the given Absence Type ID
AbsencesApi absenceTypesIdPut PUT /absenceTypes/{id} Update Absence object
AbsencesApi absenceTypesPost POST /absenceTypes Save Absence object
AbsencesApi absencesGet GET /absences Fetch all absences for the current employee given Start Date and End Date
AbsencesApi absencesIdGet GET /absences/{id} Fetch Absence for the given Absence ID
AbsencesApi absencesIdPut PUT /absences/{id} Update Absence object
AbsencesApi absencesPost POST /absences Save Absence object
AccountGroupsApi accountGroupsGet GET /accountGroups Fetch all account groups for the given clientId
AccountGroupsApi accountGroupsIdDelete DELETE /accountGroups/{id} Delete Absence Groups
AccountGroupsApi accountGroupsIdGet GET /accountGroups/{id} Fetch Account Group for the given Account Group ID
AccountGroupsApi accountGroupsIdPut PUT /accountGroups/{id} Update Account Groups Object
AccountGroupsApi accountGroupsPost POST /accountGroups Save account groups object
AccountingEntriesApi accountingEntriesGet GET /accountingEntries Fetch all Accounting Entries for the given clientId
AccountingEntriesApi accountingEntriesIdDelete DELETE /accountingEntries/{id} Delete Accounting Entry
AccountingEntriesApi accountingEntriesIdGet GET /accountingEntries/{id} Fetch Accounting Entry for the given Accounting Entry ID
AccountingEntriesApi accountingEntriesIdPut PUT /accountingEntries/{id} Update Accounting Entry Object
AccountingEntriesApi accountingEntriesPost POST /accountingEntries Save Accounting Entry Object
AccountingEntryCollectionsApi accountingEntryCollectionsGet GET /accountingEntryCollections Fetch all accounting entry collections for the given clientId
AccountingEntryCollectionsApi accountingEntryCollectionsIdDelete DELETE /accountingEntryCollections/{id} Delete accounting entry collection
AccountingEntryCollectionsApi accountingEntryCollectionsIdGet GET /accountingEntryCollections/{id} Fetch accounting entry collection for the given accounting entry collection ID
AccountingEntryCollectionsApi accountingEntryCollectionsIdPut PUT /accountingEntryCollections/{id} Update accounting entry collection
AccountingEntryCollectionsApi accountingEntryCollectionsPost POST /accountingEntryCollections Save accounting entry collections
AccountsApi accountsGet GET /accounts Fetch all Accounts for the given clientId
AccountsApi accountsIdDelete DELETE /accounts/{id} Delete Account
AccountsApi accountsIdGet GET /accounts/{id} Fetch Account given Account ID
AccountsApi accountsIdPut PUT /accounts/{id} Update Account
AccountsApi accountsPost POST /accounts Save Account
BillingApi billingsHoursGet GET /billings/hours Fetch all billings for the given parameter
BillingApi billingsHoursIdDelete DELETE /billings/hours/{id} Delete Billing
BillingApi billingsHoursIdGet GET /billings/hours/{id} Fetch Billing for the given Billing ID
BillingApi billingsHoursIdPut PUT /billings/hours/{id} Update Billing
BillingApi billingsHoursPost POST /billings/hours Save Billing
BookingYearApi bookingYearsGet GET /bookingYears Fetch all Booking Years for the given client ID
BookingYearApi bookingYearsIdDelete DELETE /bookingYears/{id} Delete Booking Year
BookingYearApi bookingYearsIdGet GET /bookingYears/{id} Fetch Booking Year for the given ID
BookingYearApi bookingYearsIdPut PUT /bookingYears/{id} Update Booking Year
BookingYearApi bookingYearsPost POST /bookingYears Save Booking Year
CalculationPositionsApi calculationPositionsGet GET /calculationPositions Fetch all calculation positions for the given client ID
CalculationPositionsApi calculationPositionsIdDelete DELETE /calculationPositions/{id} Delete calculation position
CalculationPositionsApi calculationPositionsIdGet GET /calculationPositions/{id} Fetch calculation position for the given calculation position ID
CalculationPositionsApi calculationPositionsIdPut PUT /calculationPositions/{id} Update calculation position
CalculationPositionsApi calculationPositionsPost POST /calculationPositions Save Calculation Position
CalendarEventParticipantsApi calendarEventParticipantsGet GET /calendarEventParticipants Fetch all calendar event participants
CalendarEventParticipantsApi calendarEventParticipantsIdDelete DELETE /calendarEventParticipants/{id} Delete calendar event participant
CalendarEventParticipantsApi calendarEventParticipantsIdGet GET /calendarEventParticipants/{id} Fetch calendar event participant for the given calendar event participant ID
CalendarEventParticipantsApi calendarEventParticipantsIdPut PUT /calendarEventParticipants/{id} Update calendar event participant
CalendarEventParticipantsApi calendarEventParticipantsPost POST /calendarEventParticipants Save calendar event participants
CalendarEventsApi calendarEventsGet GET /calendarEvents Fetch all calendar events at the given range
CalendarEventsApi calendarEventsIdDelete DELETE /calendarEvents/{id} Delete calendar event
CalendarEventsApi calendarEventsIdGet GET /calendarEvents/{id} Fetch calendar event for the given calendar event ID
CalendarEventsApi calendarEventsIdPut PUT /calendarEvents/{id} Update calendar event
CalendarEventsApi calendarEventsPost POST /calendarEvents Save calendar event
CategoriesApi contactCategoriesGet GET /contactCategories Fetch all contact categories
CategoriesApi contactCategoriesIdDelete DELETE /contactCategories/{id} Delete contact categorie
CategoriesApi contactCategoriesIdGet GET /contactCategories/{id} Fetch contact categorie by ID
CategoriesApi contactCategoriesIdPut PUT /contactCategories/{id} Update contact categorie
CategoriesApi contactCategoriesPost POST /contactCategories Save contact category
CategoriesApi miscCategoriesGet GET /misc/categories Fetch all Categories
ClientsApi clientsGet GET /clients Fetch all Tenants (formerly Clients)
ClientsApi clientsIdGet GET /clients/{id} Fetch client for the given client ID
ContactAccessGroupsApi contactAccessGroupsGet GET /contactAccessGroups Fetch all access groups for contacts
ContactsApi contactsGet GET /contacts Fetch all contacts
ContactsApi contactsIdDelete DELETE /contacts/{id} Delete contact
ContactsApi contactsIdGet GET /contacts/{id} Fetch contact for the given ID
ContactsApi contactsIdPut PUT /contacts/{id} Update contact
ContactsApi contactsPost POST /contacts Save contact
CurrenciesApi miscCategoriesIdGet GET /misc/categories/{id} Fetch Category given category ID
CurrenciesApi miscCurrenciesGet GET /misc/currencies Fetch all Currencies for the given clientId
CurrenciesApi miscCurrenciesIdGet GET /misc/currencies/{id} Fetch Currency given currency ID
CustomersApi customersGet GET /customers Fetch all customers for the given client ID
CustomersApi customersIdGet GET /customers/{id} Fetch customer for the given customer ID
CustomersApi customersIdPut PUT /customers/{id} Update customer
CustomersApi customersPost POST /customers Save customer
EmployeesApi employeesGet GET /employees Fetch all Employees for the given clientId
EmployeesApi employeesIdGet GET /employees/{id} Fetch Employee given Employee ID
EmployeesApi servicesIdGet GET /services/{id} Fetch Employee given Employee ID
ProjectFoldersApi projectFoldersGet GET /projectFolders Fetch all ProjectFolders for the given clientId
ProjectFoldersApi projectFoldersIdGet GET /projectFolders/{id} Fetch ProjectFolders given ProjectFolder ID
ProjectStatusesApi miscProjectStatusesGet GET /misc/projectStatuses Fetch all Project Statuses for the given clientId
ProjectStatusesApi miscProjectStatusesIdGet GET /misc/projectStatuses/{id} Fetch Project Status given Project Status ID
ProjectTypesApi miscProjectTypesGet GET /misc/projectTypes Fetch all Project Types for the given clientId
ProjectTypesApi miscProjectTypesIdGet GET /misc/projectTypes/{id} Fetch Project Types given Project Type ID
ProjectsApi projectsGet GET /projects Fetch all projects from given client
ProjectsApi projectsIdDelete DELETE /projects/{id} Delete project
ProjectsApi projectsIdGet GET /projects/{id} Fetch project for the given project ID
ProjectsApi projectsIdPut PUT /projects/{id} Update project
ProjectsApi projectsPost POST /projects Save project
ServicesApi servicesGet GET /services Fetch all Services for the given clientId
SubprojectsApi subprojectsGet GET /subprojects Fetch all Subprojects for the given clientId
SubprojectsApi subprojectsIdGet GET /subprojects/{id} Fetch Subproject given Subproject ID
SuppliersApi suppliersGet GET /suppliers Fetch all suppliers from given client
SuppliersApi suppliersIdGet GET /suppliers/{id} Fetch supplier for the given supplier ID
SuppliersApi suppliersIdPut PUT /suppliers/{id} Update supplier
SuppliersApi suppliersPost POST /suppliers Save supplier

Models

Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 2.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen