jakezatecky / work-etc-client
A thin HTTP client for WORK[etc]'s API.
Requires
- php: >=7.0
- nategood/httpful: ~0.2.20
Requires (Dev)
- mockery/mockery: dev-master
- phpunit/phpunit: ~5.1
This package is not auto-updated.
Last update: 2023-03-18 09:20:37 UTC
README
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.