Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mybuilder/when-i-work-api

Library for retrieving data from WhenIWork.com api
https://github.com/mybuilder/when-i-work-api

php php-library

Last synced: about 1 month ago
JSON representation

Library for retrieving data from WhenIWork.com api

Awesome Lists containing this project

README

        

When I Work library
=====================

This library support connection and retrieval of data from WhenIWork.com API. At least PHP 7.4 is required.

Docs:
http://dev.wheniwork.com

```php

require_once __DIR__ . '/vendor/autoload.php';

use MyBuilder\Library\WhenIWork\Repository\PayrollRepository;
use MyBuilder\Library\WhenIWork\Repository\UserRepository;
use MyBuilder\Library\WhenIWork\Service\WhenIWorkApi;

$serializer = JMS\Serializer\SerializerBuilder::create()->build();
$client = new GuzzleHttp\Client();
$whenIWorkApi = new WhenIWorkApi($client, 'your-developer-key', 'user-email', 'user-password');
$userRepository = new UserRepository($whenIWorkApi, $serializer);
$payrollRepository = new PayrollRepository($whenIWorkApi, $serializer);
```

### List of all users:

```php
$users = $userRepository->findAll();
```

### List of all payroll periods:

```php
$payrolls = $payrollRepository->findByPeriod();
```

Todos:

- Add more models that are supported via WhenIWork API
- Add more functions that are supported via WhenIWork API