basebuy / basebuy-sdk-php
Wrapper for BasebuyAutoApi
1.0.0
2017-08-09 22:18 UTC
Requires
This package is not auto-updated.
Last update: 2024-12-19 02:08:59 UTC
README
Requirements
PHP 5.3 or above
Links
- BaseBuy.Auto API page: Ru,
- sample app
Getting started
Installation
- Clone repo to your project.
- Paste following code
require_once '/path/to/cloned/repo/BasebuyAutoApi.php';
Using BaseBuy.Auto API requires following steps
-
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. -
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
-
Library throws exceptions in case of
* response status isn't equal 2** * I/O error(see [requests](https://github.com/rmccue/Requests))
Running tests
- Clone this repo.
- Install composer
- Run
composer install
- Create
sample.php
withAPI_KEY
constant. - Run it