Skip to main content

Installation

Composer

To install the bindings via Composer, add the following to composer.json:
{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/tradewatch-io/php-sdk.git"
    }
  ],
  "require": {
    "tradewatch-io/php-sdk": "*@dev"
  }
}
Then run composer install.

Manual Installation

Download the files and include autoload.php:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Usage

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api_key_query
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');

$apiInstance = new OpenAPI\Client\Api\AccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$limit = 56; // int | 
$interval = new \OpenAPI\Client\Model\AccountUsageStatisticsInterval(); // \OpenAPI\Client\Model\AccountUsageStatisticsInterval | 

try {
    $result = $apiInstance->getUsage($limit, $interval);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->getUsage: ', $e->getMessage(), PHP_EOL;
}
?>

More Examples

Find more examples in our GitHub repository.