Configuring the API
SwaggerClient-php
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
This PHP package is automatically generated by the Swagger Codegen project:
API version: v2
Build package:
io.swagger.codegen.v3.generators.php.PhpClientCodegen
Requirements
PHP 5.5 or later.
Installation and 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" } }
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 above and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiInstance = new Swagger\Client\client\AchievementsApi( // 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() ); $contact_id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | Contact identifier (GUID) try { $result = $apiInstance->achievementsGetAchievementsForContact($contact_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling AchievementsApi->achievementsGetAchievementsForContact: ', $e->getMessage(), PHP_EOL; } $apiInstance = new Swagger\Client\client\AchievementsApi( // 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() ); $offset = 56; // int | The index of the item to start from. (Default value 0) $count = 56; // int | Max number of items returned. (Default value 100) try { $result = $apiInstance->achievementsGetAllAchievements($offset, $count); print_r($result); } catch (Exception $e) { echo 'Exception when calling AchievementsApi->achievementsGetAllAchievements: ', $e->getMessage(), PHP_EOL; } $apiInstance = new Swagger\Client\client\AchievementsApi( // 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() ); $contact_id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | Contact identifier (GUID) $achievement_id = "achievement_id_example"; // string | The id for this achievement try { $apiInstance->achievementsRemoveAchievement($contact_id, $achievement_id); } catch (Exception $e) { echo 'Exception when calling AchievementsApi->achievementsRemoveAchievement: ', $e->getMessage(), PHP_EOL; } $apiInstance = new Swagger\Client\client\AchievementsApi( // 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() ); $body = new \stdClass; // object | Date of Achievement in format {"date": "2017-11-24"} $contact_id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | Contact identifier (GUID) $achievement_id = "achievement_id_example"; // string | The id of the achievement try { $apiInstance->achievementsSetAchievement($body, $contact_id, $achievement_id); } catch (Exception $e) { echo 'Exception when calling AchievementsApi->achievementsSetAchievement: ', $e->getMessage(), PHP_EOL; } ?>