This library mostly contains automatically generated code from a Forecast OpenAPI specification. As Forecast's API is not official nor documented, some API options might be missing or incomplete.
The library provides three kinds of PHP classes:
- endpoints represent requests to API methods
- models represent data from the API
- normalizers transform JSON from the API to PHP models
If you use the provided Client, you don't have to understand how the library works internally. Calling one of its method will make the HTTP request to the API and return the corresponding PHP object.
Use the ClientFactory
to generate a Client
configured with your token:
<?php
use JoliCode\Forecast\Api\Client;
use JoliCode\Forecast\ClientFactory;
/** @var Client $client */
$client = ClientFactory::create(
$accessToken,
$forecastAccountId
);
The client contains all the methods to communicate with Forecast'API. Checkout its PHP doc to know which option you can provide to each method:
<?php
//...
$assignments = $client->listAssignments([
'start_date' => '2019-01-01',
'end_date' => '2019-01-31',
])->getAssignments()
Forecast's API is not official nor documented hence some API options might be missing or incomplete.
If you miss an option in a method, please open a pull request to add it to the Forecast OpenAPI specification that we maintain, then regenerate and release a new version of the library.