jakezatecky/work-etc-client

This package is abandoned and no longer maintained. No replacement package was suggested.

A thin HTTP client for WORK[etc]'s API.

v2.0.0 2015-12-08 02:51 UTC

This package is not auto-updated.

Last update: 2023-03-18 09:20:37 UTC


README

Packagist Build Status GitHub license Scrutinizer Code Quality

Warning – This package is no longer maintained.

WorkEtcClient is a thin HTTP client to the WORK[etc] API. It handles login authentication and simple invocations of the WORK[etc] operations.

Installation

This library is only available through a Composer package. Add the following to your composer.json:

{
    "require": {
        "jakezatecky/work-etc-client": "^2.0.0"
    }
}

Usage

Usage is simple. Invoke WorkEtcClient::connect and pass in your organization's domain, your email, and your password. Then, call the invoke method and pass in the relevant operation and its required parameters as an associative array.

$domain   = 'yourcompany';
$email    = 'youremail@mail.com';
$password = 'yourpassword';

// Authenticate with WORK[etc] and get access to the API
$api = \WorkEtcClient\WorkEtcClient::connect($domain, $email, $password);

// Invoke an operation without any parameters
$stageGroups = $api->invoke('GetProjectStageGroups');

// Invoke an operation with parameters
$projects = $api->invoke('FindProjects', [
    'keywords' => 'Install',
]);

The example above is for the following WORK[etc] address. Replace yourcompany with whatever sub-domain is associated with your organization:

https://yourcompany.worketc.com

License

MIT license.