承接 netvlies/bol-openapi-php-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

netvlies/bol-openapi-php-sdk

最新稳定版本:v1.0.0

Composer 安装命令:

composer require netvlies/bol-openapi-php-sdk

包简介

The Bol OpenApi SDK for PHP developers enables you to easily develop products over the Bol OpenApi.

README 文档

README

Build Status

The Bol.com Open Api is an RESTfull API wich you can use to communicate with the Bol.com webshop catalogue. This library makes it very easy to use this API as a service within your PHP application.

You need to have a developer key to use this API. You can get one by registering at the Bol.com developer center.

License

This library is released under the MIT license. See the complete license in the LICENSE file.

Installation

First install composer and after that install the dependencies.

Requirements

PHP >=5.3.0

Using it

// ..
$httpBrowser = new \Buzz\Browser();
$accessKey = 'ABC';
$secretAccessKey = 'DEF';
$apiClient = new Client($accessKey, $secretAccessKey, $httpBrowser);
// ..

Search for products / categories

The searchresults operation returns product information by supplying keywords or ISBN/EAN. The operation has filtering and paging options.

// ..
$term = 'PHP';
$options = array(
    'categoryIdAndRefinements'  => null,
    'offset'                    => 0,
    'nrProducts'                => 10,
    'sortingMethod'             => SortingMethod::PRICE,
    'sortingAscending'          => true,
    'includeProducts'           => true,
    'includeCategories'         => true,
    'includeRefinements'        => true
);
$searchResult = $apiClient->searchResults($term, $options);
// ..

List products / categories

The listresults operation returns various product lists, based on list type and category. The category is based on the id, which can be obtained by the category list request.

For available list types see the documentation.

// ..
$type = ProductListType::TOPLIST_DEFAULT;
$categoryIdAndRefinements = '87';
$options = array(
    'offset'                => null,
    'nrProducts'            => 10,
    'sortingMethod'         => SortingMethod::TITLE,
    'sortingAscending'      => true,
    'includeProducts'       => false,
    'includeCategories'     => true,
    'includeRefinements'    => true
);
$listResult = $apiClient->listResults($type, $categoryIdAndRefinements, $options);
// ..

Get product information

The products operation gets detailed information for products.

// ...
$productId = '1002004011800815';
$productResponse = $apiClient->products($productId);
// ...

Enumerations

For a list of the possible enumerations options (for example sorting methods) take a look at the classes within the Enum namespace.

Documentation

Further documentation about the API can be found at the Bol.com developer center.

Testing

Be sure to install the dependencies first and after that just run phpunit in the lib root:

phpunit

统计信息

  • 总下载量: 1.79k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 10
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-04-03