Giter Site home page Giter Site logo

jasperzeinstra / bolcom-openapi-php-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devbolcom/bolcom-openapi-php-client

0.0 1.0 0.0 80 KB

PHP library with example for bol.com Open API

Home Page: https://developers.bol.com/wp-content/pagina/examples/phpexamplecode-v4/

PHP 100.00%

bolcom-openapi-php-client's Introduction

bol.com OpenAPI PHP client

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Client library with example code for using the bol.com Open API Version 4. If you need a client/example for Version 3 of the Open API you can use https://github.com/devbolcom/bolcom-openapi-php-client/tree/bolcom-openapi-php-client-v3

If you want to contribute to this library. You can do a Fork and a Pull request on this repo.

The library contains the following requests that are also included in the example script:

  • Ping request
  • Product request
  • Recommendation request
  • RelatedProducts request
  • Offer request
  • Lists request
  • Search request
  • Sessions request
  • Basket requests
  • Wishlist requests
  • setReferrer request (You need to ask extended permission from Developer Center team for this request)
  • Auth requests (You need to ask extended permission from Developer Center team for this request)

What are the files included:

Client

  • Request.php:
  • Setup connection with the server
  • Send session with header
  • Client.php:
  • Example code todo a request
  • Accessories.php, Basket.php, BasketItem.php, BasketItemProduct.php, Category, CategoryRefinement.php, Offers.php, Product.php, ProductFamilies.php and Product.php
  • Example classes for getting the objects

Example

  • Example.php
  • Main class to run the application
  • index.php
  • Call to the class "Example" with key, format and debug_mode and a global function to load the classes

Minimum requirements:

  • PHP 5.6 (or higher)

Installation and running the example:

  1. Get the code by forking or downloading the zip or installing Composer
  2. Upload all files (keep the directory structure) to a web-server
  3. Edit the example file "examples/Example.php" to add the right AccessKeyID (request this key at https://partnerblog.bol.com/register/), response format (xml/json) and debug mode bool (0/1)
  4. Open the browser and call the URL where your index.php file is located

Developer Documentation

https://partnerblog.bol.com/documentatie/open-api/

Basic Example

See the examples/ directory for examples of the key client features.

function __autoload($className)
{
    $fileName = preg_replace('/^BolCom\\\\(\w+)/', 'src/bolcom/$1.php', $className);
    if (file_exists($fileName)) {
        return require_once $fileName;
    }
}

$apiClient = new BolCom\Client('YOUR_APP_KEY', 'json');
$response = $apiClient->getProduct('1002004010708531');
var_dump($response);

Using Composer

composer require "bolcom/bolcom-openapi-php-client" "~2.3"

When using composer, classes are autoloaded automatically.

Running Tests

APP_KEY=YOUR_APP_KEY phpunit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.