Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

jakezatecky/work-etc-client-php

Repository files navigation

WORK[etc] Client for PHP

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    = '[email protected]';
$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.