2017 © Pedro Peláez
 

library spotoption-api-client

PHP Client for SpotOption platform

image

resnext/spotoption-api-client

PHP Client for SpotOption platform

  • Sunday, March 5, 2017
  • by AlexanderEmelyanov
  • Repository
  • 1 Watchers
  • 1 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

SpotOption API Client.

API Client for binary options platform SpotOption., (*1)

Installation

Install using Composer, doubtless., (*2)

$ composer require resnext/spotoption-api-client

General API Client usage.

$apiClient = new SpotOption\ApiClient(<URL>, <USERNAME>, <PASSWORD>);

Error handling

Each method of \SpotOption\ApiClient can return response object (instance of \SpotOption\Response) or throws two kind of exceptions., (*3)

  1. \SpotOption\ServerException Server-side exception assigned with invalid data received of impossible operation is requested.
  2. \SpotOption\ClientException Client-side exception means API Client cannot connect to SpotOption servers or receive invalid response with any reasons.

Configuration and customization

Your can configure used HTTP client using $options param of ApiClient constructor., (*4)

Example:, (*5)

$httpClient = new GuzzleHttp\Client([
   GuzzleHttp\RequestOptions::CONNECT_TIMEOUT => 2,
]);

$apiClient = new \SpotOption\ApiClient(<API_URL>, <API_USERNAME>, <API_PASSWORD>, [
    'httpClient' => $httpClient,
]);

Countries retrieving

/** @var \SpotOption\Responses\GetCountriesResponse $response */
$response = $this->apiClient->getCountries();
/** @var \SpotOption\Entities\Country[] $countries */
$countries = $response->getData();

Campaigns retrieving

This example retrieves all campaign with type CPA., (*6)

/** @var \SpotOption\Responses\GetCampaigns $response */
$response = $this->apiClient->getCampaigns(\SpotOption\Entities\Campaign::TYPE_CPA);
/** @var \SpotOption\Entities\Campaign[] $countries */
$countries = $response->getData();

Customer validation

/** @var \SpotOption\Responses\ValidateCustomerResponse
$response = $apiClient->validateCustomer('email@domain.com', 'password');

The Versions

05/03 2017

dev-master

9999999-dev

PHP Client for SpotOption platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options spotoption

05/03 2017

v0.1.1

0.1.1.0

PHP Client for SpotOption platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options spotoption

23/10 2016

v0.1.0

0.1.0.0

PHP Client for SpotOption platform

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Emelyanov

api binary options spotoption