Skip to content

Create A Client

Zander Janse van Rensburg edited this page Jun 12, 2017 · 1 revision

Once you have an authenticated access token, creating a SDK client is as easy as:

$client = new \Tngnt\PBI\Client($token);

Override HTTP Client

The SDK uses the Guzzle 6 HTTP client. By default it creates a client with the following headers:

  • Accept: application/json
  • Authorization: Bearer

You can override the default client by specifying your custom client as the second parameter:

$httpClient = new GuzzleHttp\Client([
    'proxy' => [
        'https' => 'tcp://localhost:1234',
    ]
]);
$client = new \Tngnt\PBI\Client($token, $httpClient);

Clone this wiki locally