1. Go to this page and download the library: Download dant89/ix-api-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/ */
dant89 / ix-api-client example snippets
use Dant89\IXAPIClient\Client;
// Create base client
$client = new Client(IXAPI_URL);
// Get a bearer token from key / secret
$response = $client->getHttpClient(HttpClientType::AUTH)
->postAuthToken(IXAPI_KEY, IXAPI_SECRET);
// Check for valid response status
if ($response->getStatus() === 200) {
$client->setBearerToken($response->getContent()['access_token']);
}
// Query for products
$response = $client->getHttpClient(HttpClientType::PRODUCT_OFFERINGS)
->get();
// Check for valid response and set the array of products
if ($response->getStatus() === 200) {
$productOfferings = $response->getContent();
}