jdecool / clockify-api
PHP Client for Clockify.me API
Installs: 2 650
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 6
Forks: 8
Open Issues: 2
Requires
- php: ^7.3
- ext-json: *
- myclabs/php-enum: ^1.7
- php-http/client-common: ^2.3
- php-http/discovery: ^1.12
- php-http/httplug: ^2.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- guzzlehttp/guzzle: ^7.0
- http-interop/http-factory-guzzle: ^1.0
- phpstan/phpstan: ^0.11.16
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2024-10-23 19:49:54 UTC
README
PHP client for Clockify.me API.
Install it
You need to install the library with a PSR-18 compliant HTTP client.
Example using Guzzle:
composer require jdecool/clockify-api guzzlehttp/guzzle http-interop/http-factory-guzzle
The library is decoupled from any HTTP message client with HTTPlug.
That's why you need to install a client implementation http://httplug.io/
in this example.
Getting started
Use the HTTP client
<?php require __DIR__.'/vendor/autoload.php'; $builder = new JDecool\Clockify\ClientBuilder(); $client = $builder->createClientV1('your-clockify-api-key'); $workspaces = $client->get('workspaces');
Use the decicated API client
require __DIR__.'/vendor/autoload.php'; $builder = new JDecool\Clockify\ClientBuilder(); $client = $builder->createClientV1('your-clockify-api-key'); $apiFactory = new JDecool\Clockify\ApiFactory($client); $workspaceApi = $apiFactory->workspaceApi(); $workspaces = $workspaceApi->workspaces(); // return an array of JDecool\Clockify\Model\WorkspaceDto
Available APIs:
LICENSE
This library is licensed under the MIT License.