2017 © Pedro Peláez
 

library avin

Avin, avin.cc api client

image

websoftwares/avin

Avin, avin.cc api client

  • Tuesday, July 30, 2013
  • by Websoftwares
  • Repository
  • 0 Watchers
  • 2 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Avin

Client for interacting with the avin.cc JSON RESTful api., (*1)

Build Status, (*2)

Documentation

We encourage you to read the documentation carefully before proceeding., (*3)

Api Key

The AVIN API requires a developer key which you can ask avin.cc using this email address: info@avin.cc., (*4)

Install composer in your project:, (*5)

curl -s http://getcomposer.org/installer | php

Create a composer.json file in your project root:, (*6)

{
    "require": {
        "websoftwares/avin": "dev-master"
    }
}

Install via composer, (*7)

php composer.phar install

Usage

Below u find a list with available methods., (*8)

GetWineByAvin

Gets a wine by Avin., (*9)

use Websoftwares\AvinClient, Websoftwares\Avin;

$avin = new Avin(new AvinClient('123456789YourApiKey'));
$avin->GetWineByAvin('AVIN0123456789012');

GetWinesByName

Gets wine by name., (*10)

use Websoftwares\AvinClient, Websoftwares\Avin;

$avin = new Avin(new AvinClient('123456789YourApiKey'));
$avin->GetWinesByName('Era');

GetCountries

Gets a list of countries., (*11)

use Websoftwares\AvinClient, Websoftwares\Avin;

$avin = new Avin(new AvinClient('123456789YourApiKey'));
$avin->GetCountries();

GetWineTypes

Gets a list of wine types., (*12)

use Websoftwares\AvinClient, Websoftwares\Avin;

$avin = new Avin(new AvinClient('123456789YourApiKey'));
$avin->GetWineTypes();

GetProducerByID

Gets a producer by id., (*13)

use Websoftwares\AvinClient, Websoftwares\Avin;

$avin = new Avin(new AvinClient('123456789YourApiKey'));
$avin->GetProducerByID(12345);

GetProducerByName

Gets a producer by name., (*14)

use Websoftwares\AvinClient, Websoftwares\Avin;

$avin = new Avin(new AvinClient('123456789YourApiKey'));
$avin->GetProducerByName('Producer sample name');

setFilter

Please read the documentation for a complete list of available filters., (*15)

use Websoftwares\AvinClient, Websoftwares\Avin;

$avin = new Avin(new AvinClient('123456789YourApiKey'));

$avin
    ->setFilter('vintage', 2003)
    ->setFilter('country', 620)
    ->setFilter('type', '1')
    ->setFilter('producer', 'Cortes de Cima')
    ->GetWineByAvin('AVIN6452997073019');

Error messages

Use try/catch block to get error messages., (*16)

use Websoftwares\AvinClient,
    Websoftwares\Avin,
    Websoftwares\AvinException;

try {
    $avin = new Avin(new AvinClient('123456789YourApiKey'));
    $avin->GetWinesByName('Era');
} catch (AvinException $e) {
    echo $e->getMessage();
}

Testing

In the tests folder u can find several tests for online and offline., (*17)

The Versions

30/07 2013

dev-master

9999999-dev

Avin, avin.cc api client

  Sources   Download

dbad

The Requires

  • php >=5.3.0
  • ext-curl *
  • ext-json *

 

The Development Requires

by Boris Verhaaff

api avin