Skip to content

Commit

Permalink
prepare for release + added an example in the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierlacot committed Jul 29, 2020
1 parent d07ceda commit 9cfb5bf
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

## Unreleased

Nothing
* nothing

## 4.0.1 (2020-07-30)

* upgrade to `janephp/open-api` 6.0
* fixed boolean query parameters serialization

## 4.0.0 (2020-05-14)

Expand Down Expand Up @@ -30,7 +35,7 @@ Nothing
* several new "report" endpoints
* support for `rounded_hours` in the `TimeEntry` model

## 2.1.0
## 2.1.0 (2020-01-14)

* updated the OpenAPI definition file
* added the "company update" endpoint
Expand Down
20 changes: 20 additions & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ $clients = $harvestClient->listClients([
])->getClients();
```

## Available operations

Instead of `listClients()`, you can use all of these methods:

* Clients:
Expand Down Expand Up @@ -174,6 +176,24 @@ Instead of `listClients()`, you can use all of these methods:
* `retrieveCostRate()`
* `listActiveProjectAssignments()`

## Examples

### Create an invoice

```php
use JoliCode\Harvest\ClientFactory;

$harvestClient = ClientFactory::create(
$accessToken,
$harvestAccountId
);

$payload = new \JoliCode\Harvest\Api\Model\InvoicesPostBody();
$payload->setClientId(123456);
$payload->setSubject('test invoice, please delete it');
$invoice = $client->createInvoice($payload);
```

## Bypassing the incomplete API specification

Harvest's API does not have an officially supported OpenAPI specification. This library is automatically generated from an OpenAPI specification which has itself been generated by crawling Harvest's API html documentation pages. Hence, some API options might be
Expand Down

0 comments on commit 9cfb5bf

Please sign in to comment.