PHP wrapper for the Cloud Factory API
composer require inserve/cloud-factory-api-php
use GuzzleHttp\Client;
use Inserve\CloudFactoryAPI\CloudFactoryAPIClient;
require 'vendor/autoload.php';
$guzzle = new Client([
'base_uri' => 'https://portal.api.cloudfactory.dk',
]);
$cloudFactory = new CloudFactoryAPIClient(
client: $guzzle,
);
$accessToken = $api->exchangeRefreshToken('refresh.token');
$cloudFactory->setAccessToken($accessToken);
if (! $cloudFactory->isAuthenticated()) {
return;
}
$customerList = $cloudFactory->getCustomers([
'PageSize' => 100
]);
foreach ($customerList->getResults() as $customer) {
echo $customer->getName() . PHP_EOL;
}