rauwebieten / vaf-api-php-client
1.1.3
2020-03-02 13:58 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
README
Private API for VAF partners
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: apiAuth $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Api-Key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Api-Key', 'Bearer'); $apiInstance = new Swagger\Client\Api\DefaultApi( // 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 ); $id = "id_example"; // string | The ID of the asset try { $result = $apiInstance->assetsIdDownloadGet($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->assetsIdDownloadGet: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiAuth $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Api-Key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Api-Key', 'Bearer'); $apiInstance = new Swagger\Client\Api\DefaultApi( // 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 ); $id = "id_example"; // string | The ID of the asset try { $result = $apiInstance->assetsIdGet($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->assetsIdGet: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiAuth $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Api-Key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Api-Key', 'Bearer'); $apiInstance = new Swagger\Client\Api\DefaultApi( // 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 ); try { $result = $apiInstance->filmsGet(); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->filmsGet: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiAuth $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Api-Key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Api-Key', 'Bearer'); $apiInstance = new Swagger\Client\Api\DefaultApi( // 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 ); $id = "id_example"; // string | The ID of the film try { $result = $apiInstance->filmsIdGet($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->filmsIdGet: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiAuth $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Api-Key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Api-Key', 'Bearer'); $apiInstance = new Swagger\Client\Api\DefaultApi( // 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 ); $id = "id_example"; // string | The ID of the film try { $result = $apiInstance->filmsIdPostersGet($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->filmsIdPostersGet: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiAuth $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Api-Key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Api-Key', 'Bearer'); $apiInstance = new Swagger\Client\Api\DefaultApi( // 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 ); $id = "id_example"; // string | The ID of the film try { $result = $apiInstance->filmsIdStillsGet($id); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->filmsIdStillsGet: ', $e->getMessage(), PHP_EOL; } // Configure API key authorization: apiAuth $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Api-Key', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Api-Key', 'Bearer'); $apiInstance = new Swagger\Client\Api\DefaultApi( // 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 ); try { $result = $apiInstance->rootGet(); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->rootGet: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to http://api.vaf.be/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | assetsIdDownloadGet | GET /assets/{id}/download | Returns binary data by asset id |
DefaultApi | assetsIdGet | GET /assets/{id} | Returns a asset by id |
DefaultApi | filmsGet | GET /films | Returns all films |
DefaultApi | filmsIdGet | GET /films/{id} | Returns a film by id |
DefaultApi | filmsIdPostersGet | GET /films/{id}/posters | Returns posters (assets) for a film |
DefaultApi | filmsIdStillsGet | GET /films/{id}/stills | Returns stills (assets) for a film |
DefaultApi | rootGet | GET / | Returns API version info |
Documentation For Models
Documentation For Authorization
apiAuth
- Type: API key
- API key parameter name: X-Api-Key
- Location: HTTP header