Connect client class allows running multiple operations in Connect like get the list of requests, configurations, etc.
Client class may be instantiated from any application to obtain information needed to run an operation, like, for example, get the Asset information in the context of an action. Client provides access to:
This is an example to create a client:
<?php
require_once ("./vendor/autoload.php");
##Note that in case of no Configuration passed to constructor, system will check if config.json exists
$connect = new Connect\ConnectClient(new \Connect\Config([
"apiKey" => "SU-677-956-738:ca95348138a3c12XXXXXXXXXXe42d30bde6c",
"apiEndpoint" => "https://api.connect.cloudblue.com/public/v1",
"logLevel"=> 7,
"timeout" => 120,
"sslVerifyHost"=> false
]));
$connect->directory->listTierConfigs()
<?php
$connect = new Connect\ConnectClient();
$tierConfigurations = $connect->directory->listTierConfigs();
$tierConfigurations = $connect->directory->listTierConfigs(["account.id" => 'T-0-123123132123123']);
<?php
$connect = new Connect\ConnectClient();
$tierConfiguration = $connect->directory->getTierConfigById('TC-000-000-000');
<?php
$connect = new Connect\ConnectClient();
$assets = $connect->directory->listAssets();
$assets = $connect->directory->listAssets(["product.id" => "PRD-XXXX-XXXX-XXXX"]);
<?php
$connect = new Connect\ConnectClient();
$asset = $connect->directory->getAssetById('AS-123-123-123');
<?php
$connect = new Connect\ConnectClient();
$products = $connect->directory->listProducts();
<?php
$connect = new Connect\ConnectClient();
$product = $connect->directory->getProduct('PRD-XXXX-XXXX-XXXX');
In case of no filter, pending ones are returned
<?php
$connect = new Connect\ConnectClient();
$requests = $connect->fulfillment->listRequests();
$requests = $connect->fulfillment->listRequests(['status' => 'approved']);
<?php
$connect = new Connect\ConnectClient();
$request = $connect->fulfillment->getRequest('PR-XXXX-XXXX-XXXXX');
<?php
$connect = new Connect\ConnectClient();
//List all tier accounts from a given marketplace
$tierAccounts = $connect->directory->listTierAccounts(['marketplace' => 'MP-XXXXXXX']);
<?php
$connect = new Connect\ConnectClient();
$tierAccounts = $connect->directory->getTierAccountById('TA-XXXXXX-XXXXX');
<?php
$connect = new Connect\ConnectClient();
$tar = $connect->directory->listTierAccountRequests(['status' => 'pending']);
<?php
$connect = new Connect\ConnectClient();
$billingAssets = $connect->subscriptions->listSubscriptionAssets();
<?php
$connect = new Connect\ConnectClient();
$billingAsset = $connect->subscriptions->getSubscriptionAssetById('AS-1234-1234');
<?php
$connect = new Connect\ConnectClient();
$billingRequests = $connect->subscriptions->listSubscriptionRequests();
<?php
$connect = new Connect\ConnectClient();
$billingAsset = $connect->subscriptions->getSubscriptionRequestById('PR-XXXXX-XXXXX-XXXXX');