efficimo/tilkee-php

PHP implementation of Tilkee API https://tilkee.readme.io/ (fork https://gitlab.com/hbs-research/tilkee-php)

4.0.9 2019-12-17 08:06 UTC

This package is auto-updated.

Last update: 2024-04-24 15:03:05 UTC


README

HbsResearch\Tilkee PHP is a HbsResearch\Tilkee client written in PHP.
This client supports the API v1

Important: This library doesn't support the full API for now.
You are more than welcome to contribute to the swagger specifications

Installation

The recommended way to install HbsResearch\Tilkee PHP is through Composer:

composer require hbs-research/tilkee-php

Usage Examples

List projects

<?php

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

use Http\Message\Authentication\Bearer;

use HbsResearch\Tilkee\HbsResearch\Tilkee;
use HbsResearch\Tilkee\TilkeeClient;

// Place here your API key or Oauth Token
$token = 'YOUR_TOKEN';
// Here is your unique tilk ref provided by HbsResearch\Tilkee
$tilkRef = 'TilkTestClient';


$authentication = new Bearer($token);
$tilkeeClient = new TilkeeClient($authentication, $tilkRef);
$tilkee = new HbsResearch\Tilkee($tilkeeClient);

$projectList = $tilkee->getProjectManager()->listProject()->getContents();

foreach ($projectList as $project) {
    echo sprintf("%s: %s\n", $project->getId(), $project->getName());
}

Regenerating the API stubs

# get jane OpenAPI
composer install --dev

rm -rf generated/*
./vendor/bin/jane-openapi generate -c .jane-openapi 

Using docker

If you don't want to mess up your system, you can use the provided Docker Dockerfile.

docker build --rm -t tilkee-php .

Then, use the shortcut tilkee

./bin/tilkee your_command_here 

Contributing

Please see CONTRIBUTING for details.

Credits

This library use Jane Open Api to generate the API stubs from a custom OpenApi (Swagger) specification file: tilkee-swagger.yml

This README is inspired by willdurand/Negotiation by @willdurand.

License

The MIT License (MIT). Please see License File for more information.