Skip to content

jdecool/clockify-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4d0db20 · Nov 23, 2023

History

57 Commits
Oct 1, 2021
Nov 23, 2023
Oct 1, 2021
Sep 19, 2019
Sep 19, 2019
Oct 1, 2021
Oct 1, 2021
Sep 19, 2019
Sep 30, 2020
Nov 23, 2023
Nov 25, 2020
Oct 1, 2021

Repository files navigation

Clockify API client

Build Status Scrutinizer Code Quality Latest Stable Version

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.