dev-master
9999999-devAvin, avin.cc api client
dbad
The Requires
- php >=5.3.0
- ext-curl *
- ext-json *
The Development Requires
by Boris Verhaaff
api avin
Avin, avin.cc api client
Client for interacting with the avin.cc JSON RESTful api., (*1)
We encourage you to read the documentation carefully before proceeding., (*3)
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
Below u find a list with available methods., (*8)
Gets a wine by Avin., (*9)
use Websoftwares\AvinClient, Websoftwares\Avin; $avin = new Avin(new AvinClient('123456789YourApiKey')); $avin->GetWineByAvin('AVIN0123456789012');
Gets wine by name., (*10)
use Websoftwares\AvinClient, Websoftwares\Avin; $avin = new Avin(new AvinClient('123456789YourApiKey')); $avin->GetWinesByName('Era');
Gets a list of countries., (*11)
use Websoftwares\AvinClient, Websoftwares\Avin; $avin = new Avin(new AvinClient('123456789YourApiKey')); $avin->GetCountries();
Gets a list of wine types., (*12)
use Websoftwares\AvinClient, Websoftwares\Avin; $avin = new Avin(new AvinClient('123456789YourApiKey')); $avin->GetWineTypes();
Gets a producer by id., (*13)
use Websoftwares\AvinClient, Websoftwares\Avin; $avin = new Avin(new AvinClient('123456789YourApiKey')); $avin->GetProducerByID(12345);
Gets a producer by name., (*14)
use Websoftwares\AvinClient, Websoftwares\Avin; $avin = new Avin(new AvinClient('123456789YourApiKey')); $avin->GetProducerByName('Producer sample name');
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');
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(); }
In the tests folder u can find several tests for online and offline., (*17)
Avin, avin.cc api client
dbad
api avin