windsor/master-client

There is no license information available for the latest version (dev-master) of this package.

HTTP client to interact with the primary Windsor Telecom API

dev-master 2019-08-01 14:05 UTC

This package is auto-updated.

Last update: 2023-03-21 19:10:29 UTC


README

Currently in alpha, do not use in production

Usage

<?php

$guzzle = new GuzzleHttp\Client([
    'base_uri' => '' // set me
]);

$client = new Windsor\Master\Client($guzzle);
$client->authenticate(''); // set me

try {
    $response = $client->get('contracts');
    $data = json_decode($response, true);
    
    foreach ($data['data'] as $contracts) {
        // do something
    }
} catch (Windsor\Master\Exception $e) {
    echo $e->getMessage()."\n";

    if ($e->getType() == 'unknown') {
        echo 'Request ref: '.$e->getRef()."\n";
    }
}