$ git clone [email protected]:valsplat/employes-api-client.git
$ cd employes-api-client
$ composer update -o
$ composer require valsplat/employes-api-client
The API does -unfortunately- not expose all data at this time. The available endpoints:
employee
leave
Authentication is done via a token:
$connection = new \Valsplat\Employes\Connection;
$connection->setAdministrationId('YOUR_ADMINISTRATION_GUID');
$connection->setBearerToken('YOUR_BEARER_TOKEN');
The API client throws two exceptions:
\Valsplat\Employes\Exceptions\NotFoundException
- Entity could not be found\Valsplat\Employes\Exceptions\ApiException
- Generic Api exception
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();
list((array)params)
- get a collection of entities. Available parameters:limit
- limit the amount of entities returnedoffset
- set offset
get((int)id)
- get a single entity via its id.create()
- create given entity.update()
- update given entity.save()
- convenience method; callsupdate()
if the entity already exists,create()
otherwise.delete()
- delete given entity.
Authentication and usage examples: example.php