Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

valsplat/employes-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employes Api Client for PHP

Contributing

$ git clone [email protected]:valsplat/employes-api-client.git
$ cd employes-api-client
$ composer update -o

Installation

$ composer require valsplat/employes-api-client

Endpoints

The API does -unfortunately- not expose all data at this time. The available endpoints:

  • employee
  • leave

Authentication

Authentication is done via a token:

$connection = new \Valsplat\Employes\Connection;
$connection->setAdministrationId('YOUR_ADMINISTRATION_GUID');
$connection->setBearerToken('YOUR_BEARER_TOKEN');

Errors

The API client throws two exceptions:

  • \Valsplat\Employes\Exceptions\NotFoundException - Entity could not be found
  • \Valsplat\Employes\Exceptions\ApiException - Generic Api exception

Basic Usage

Each endpoint is accessible via its own method on the \Valsplat\Employes\EmployesApi instance. The method name is singular, camelcased:

$employes = new \Valsplat\Employes\EmployesApi($connection);
$employes->employees();

Generic methods & filters

  • list((array)params) - get a collection of entities. Available parameters:
    • limit - limit the amount of entities returned
    • offset - set offset
  • get((int)id) - get a single entity via its id.
  • create() - create given entity.
  • update() - update given entity.
  • save() - convenience method; calls update() if the entity already exists, create() otherwise.
  • delete() - delete given entity.

Usage examples

Authentication and usage examples: example.php

About

Unofficial Employes API Client for PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages