Skip to content
SDK for BaseBuy Auto API on PHP
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
connectors Safe defaults in CurlGetConnector. More parameters in sample.php Aug 9, 2017
exceptions init Mar 13, 2016
models init Mar 13, 2016
.gitignore init Mar 13, 2016
BasebuyAutoApi.php init Mar 13, 2016
IConnector.php init Mar 13, 2016
LICENSE
README.md
composer.json
sample.php Safe defaults in CurlGetConnector. More parameters in sample.php Aug 9, 2017

README.md

PHP BaseBuy.Auto API SDK

Requirements

PHP 5.3 or above

Links

  1. BaseBuy.Auto API page: Ru,
  2. sample app

Getting started

Installation

  1. Clone repo to your project.
  2. Paste following code
    require_once '/path/to/cloned/repo/BasebuyAutoApi.php';
    

Using BaseBuy.Auto API requires following steps

  1. Obtain API_KEY (token) by buying database at http://basebuy.ru. Note: API_KEY is constant that you get for access to BaseBuy.Auto API.

  2. Than you can use BaseBuy.Auto API.

    $basebuyAutoApi = new BasebuyAutoApi(
        new CurlGetConnector( API_KEY )
    );
    
    // check last information update date
    $basebuyAutoApi->typeGetDateUpdate();
    
    // get database file
    $downloadedFilePath = $basebuyAutoApi->typeGetAll();
    
    // catch error codes
    } catch( Exception $e ){
        if ( $e->getCode() == 401 ) ...
    }
    

Side notes

  1. Library throws exceptions in case of

    * response status isn't equal 2**
    * I/O error(see [requests](https://github.com/rmccue/Requests))
    

Running tests

  1. Clone this repo.
  2. Install composer
  3. Run composer install
  4. Create sample.php with API_KEY constant.
  5. Run it
You can’t perform that action at this time.