1. Go to this page and download the library: Download germania-kg/jsonapi-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
germania-kg / jsonapi-client example snippets
use Germania\JsonApiClient\GuzzleFactory;
// Have your Web API endpoint and Access token at hand
$api = "https://api.example.com/"
$token = "manymanyletters";
// Setup a Guzzle Client that will ask the Web API
$guzzle = (new GuzzleFactory)( $api, $token);
use Germania\JsonApiClient\JsonApiClient;
use Germania\JsonApiClient\GuzzleFactory;
use GuzzleHttp\Client;
$guzzle = new Client( ... );
$guzzle = (new GuzzleFactory)( $api, $token);
$cache = new \Stash\Pool( ... );
$logger = new \Monolog\Logger( ... );
$api_client = new JsonApiClient($guzzle, $cache );
$api_client = new JsonApiClient($guzzle, $cache, $logger );
$api_client = new JsonApiClient($guzzle, $cache, $logger, "alert" );
use Germania\JsonApiClient\JsonApiClientExceptionInterface;
use Germania\JsonApiClient\{
JsonApiClientCacheException,
JsonApiClientRequestException,
JsonApiClientResponseException,
JsonApiClientResultsException
};