There is no license information available for the latest version (v0.1) of this package.

Voradius API service

v0.1 2015-08-11 07:22 UTC

This package is not auto-updated.

Last update: 2024-04-13 15:39:22 UTC


README

Build Status Latest Stable Version Dependency Code Climate Scrutinizer Code Quality

Voradius API

This library is aimed at wrapping the Voradius API in a simple package.

Table Of Content

  1. Requirements
  2. Installation
  3. General Example

Requirements

This library uses PHP 5.4+.

To use the API, you have to request an access key from Voradius. For every request, you will have to provide the Access Key.

Installation

It is recommended that you install the PHP API Wrapper library through composer. To do so, add the following lines to your composer.json file.

{
    "require": {
        "Voradius/api": "dev-master"
    }
}

General example

All Entity classes need a Client object supplied on creating an object, with both the API Key and Environment supplied, as below.

Valid environments for external usage are:

  • SANDBOX (for testing)
  • LIVE
$client = new Voradius\Client('API_KEY_HERE', Voradius\Client::SANDBOX]);
$productApi = new Entity\Product($client);
````

After creating the entity object it is possible to use the several methods provided in this entity, e.g.:

````
$product = $productApi->getById(1000);
````

All entities check for valid input and build the request to the Voradius API for you. Errors are thrown by the Guzzle library, else the content is just returned directly to you. In most cases this will be a JSON formatted string. We don't manipulate the data on return, giving you all the freedom to perform caching and/or manipulate the data before usage.