Zend Framework module with API client to access Alibris API
Install the module using Composer into your application's vendor directory. Add the following line to your
composer.json
.
{
"require": {
"firelike/alibris": "^1.*"
}
}
Enable the module in your application.config.php
file.
return array(
'modules' => array(
'Firelike\Alibris'
)
);
Copy and paste the alibris.local.php.dist
file to your config/autoload
folder and customize it with your credentials and
other configuration settings. Make sure to remove .dist
from your file.Your alibris.local.php
might look something like the following:
<?php
return [
'alibris_service' => [
'service_url' => 'http://api.alibris.com/v1/public/',
'api_key' => '<your-api-key>'
]
];
use Firelike\Alibris\Service\AlibrisService;
$service = new AlibrisService();
$params = [
'wquery' => 'grisham'
];
$records = $service->search($params);
var_dump($records);
$params = [
'query' => 'train'
];
$records= $service->itemSearch($params);
$params = [
'work' => 'connelly'
];
$records= $service->recommend($params);
$params = [
'work' => 'king'
];
$records= $service->review($params);
- search
- itemSearch
- recommend
- review