dev-master
9999999-devWhiteWorks API client for PHP 5.5+, based on Guzzle 6
GPLv3
The Requires
- php ^5.6 || ^7.0
- graze/guzzle-jsonrpc ^3.0
The Development Requires
by Roelof Roos
WhiteWorks API client for PHP 5.5+, based on Guzzle 6
![Coverage Status][cov] , (*1)
A WhiteWorks API client for PHP5.5+, based on Guzzle 6, (*2)
The software is licensed under a GPLv3 license. We chose this license to invite others to help improve this repository, instead of improving it and keeping the code closed-source., (*3)
In case this does not meet your business needs, please contact us., (*4)
This library has the following requirements:, (*5)
The easiest way to start using this library, is by installing it via Composer., (*6)
composer require schakel/whiteworks-api
If you don't have access to composer, you can download or clone the repository.
Make sure you map the \Schakel\WhiteWorks
namespace to the src/
directory of this project in your PSR-4 compliant autoloader., (*7)
The main client can be found as Schakel\WhiteWorks\Client
. As this is an
extension of the Guzzle-based [JSON-RPC client][json-client], calling the
constructor requires a few presets, which can be easily loade using the
Client::factory
method., (*8)
The Factory method requires an api_key
and a hostname
. These are expected
as the first and only argument of Client::factory
., (*9)
<?php $client = Schakel\WhiteWorks\Client::factory([ 'api_key' => 'YOUR-API-KEY', 'hostname' => 'YOUR-BUSINESS-NAME.whiteworks.nl' ]);
Optionally, you can add 'debug' => true
to get more debug messages. This is,
ofcourse, not recommended for production systems., (*10)
The Schakel\WhiteWorks\Client
has a getApi method, that will return the
correct Api for the entity you'd like to retrieve. A list of APIs can be found
in the doc/ folder., (*11)
<?php require_once __DIR__ . '/vendor/autoload.php'; use Schakel\WhiteWorks\Client; $client = Client::factory([ 'api_key': 'ci2ahp7eebeir3Oochai9oo4aWe7ac' // Your API key 'hostname': 'mycompany.whiteworks.nl' // Hostname, /without/ scheme ]); $allClients = $client->getApi('contact')->getAll(); foreach ($allClients as $client) { echo "{$client->getName()}\n"; }
Everyone is welcome to help us realise this program, there are however a few requirements:, (*12)
left-pad
phenomena)All pull requests are tested by Travis CI and Coveralls to make sure they work as intended. We aim for a coverage rate > 70%., (*13)
Please add your name and e-mail or handle above all classes you write, so we can contact you should anything go awol afterwards. Adding yourself to AUTHORS is also highly recommended., (*14)
WhiteWorks API client for PHP 5.5+, based on Guzzle 6
GPLv3