programster / harvest-sdk-guzzle-driver
A Guzzle-based message handler for the PHP SDK for the Harvest API.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:sdk
Requires
- php: >=7.4.0
- guzzlehttp/guzzle: ^7.3
- programster/harvest-sdk: dev-main
This package is not auto-updated.
Last update: 2024-11-07 01:33:58 UTC
README
A Guzzle-based driver for the Harvest SDK.
Installation
composer require programster/harvest-sdk-guzzle-driver
Example Usage
<?php require_once(__DIR__ . '/vendor/autoload.php'); $guzzleDriver = new \Programster\HarvestGuzzleDriver\Driver(); $harvestClient = new \Programster\Harvest\HarvestClient( $harvestAccountId="xxx", $harvestTokenId="xxx", $guzzleDriver ); $response = $harvestClient->getTimeEntries(); if ($response->getStatusCode() === 200) { $responseObject = json_decode($response->getBody()); print "Harvest Response: " . print_r($responseObject, true) . PHP_EOL; } else { print "Something wen't wrong! Your authentication details are probably incorrect."; }