vinou / api-connector
Vinou API Connnector
Requires
- php: >=7.2
- guzzlehttp/guzzle: *
- jaybizzle/crawler-detect: *
- monolog/monolog: ^2.1.0
- dev-master
- 3.3.1
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.0
- 2.4.7
- 2.4.6
- 2.4.5
- 2.4.4
- 2.4.2
- 2.4.1
- 2.3.14
- 2.3.13
- 2.3.12
- 2.3.11
- 2.3.10
- 2.3.9
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-marketplace_integration
- dev-development
- dev-php-71
This package is auto-updated.
Last update: 2025-03-17 11:11:08 UTC
README
The Vinou API Connector is a PHP library that provides the stable functions and utilities that are enabled within the Vinou-Service-API and the Vinou-Public-API.
Table of contents
Installation
composer install vinou/api-connector
Usage Example
1. Basic instantiation
$api = new \Vinou\ApiConnector\Api ( TOKEN_FOR_INSTANCE, AUTHID_FOR_VINOU_CUSTOMER );
2. Instantiation with settings (recommended)
At first use constants to define path to config.yml
define(VINOU_CONFIG_DIR, '/Path/to/settings.yml');
The settings.yml looks like (Be careful keys are case sensitive)
vinou: token: TOKEN_FOR_INSTANCE authid: AUTHID_FOR_VINOU_CUSTOMER
than you can instantiate without piping the variables to the API-Object
$api = new \Vinou\ApiConnector\Api();
3. Improve session handling
By default the generated login token is stored to session. If you want to configure some additional api parameters or if you have some login issues it is better to instantiate a specific Vinou-Session before.
$session = new \Vinou\ApiConnector\Session\Session (); $session::setValue('language','de');
This session handling is able to detect a TYPO3 session
4. Example function call
// returns all public wines of your Vinou-Office Account as php array $api->getWinesAll()
5. Prepare Ajax connection (content of ajax.php e.g. called via https://your.domain.com/ajax.php)
<?php require_once __DIR__ . '/../vendor/autoload.php'; define('VINOU_ROOT', realpath('./')); define('VINOU_MODE', 'Ajax'); define('VINOU_CONFIG_DIR', '../config/'); header('Cache-Control: no-cache, must-revalidate'); header('Content-type: application/json'); // INIT SESSION BEFORE ALL THE OTHER STUFF STARTS $session = new \Vinou\ApiConnector\Session\Session (); $session::setValue('language','de'); $ajax = new \Vinou\ApiConnector\Ajax (); $ajax->run(); ?>
Constants
Main options are set by constants. The following constants are avaiable.
Constant | Default | Options | Description |
---|---|---|---|
VINOU_ROOT |
[DOCROOT] | /Path/to/application/dir |
Improvement settings for some older environments if document root is not correctly set via server variable |
VINOU_CONFIG_DIR |
not set | /Path/to/settings.yml |
If set use configuration via settings.yml] |
VINOU_LOG_DIR |
logs/ | /Path/to/log/dir/ |
Directory for logfiles |
VINOU_LOG_LEVEL |
ERROR | Loglevel from monolog | |
VINOU_DEBUG |
false | Boolean | If set special breakpoints in sdk are written to logfiles |
VINOU_MODE |
not set | Shop |
load only objects marked with shop flag in Vinou-Office |
Winelist |
load only objects marked as public in Vinou-Office | ||
VINOU_SOURCE |
Live | Live |
Use production API https://api.vinou.de |
Staging |
Use staging API https://api.staging.vinou.de (Ready to use features) | ||
Dev |
Use development API https://api.developmentvinou.de (All new features up from alpha status) |
Classlist
Class | Description |
---|---|
\Vinou\ApiConnector\Api | Main API SDK class |
\Vinou\ApiConnector\PublicApi | API SDK for small public API |
\Vinou\ApiConnector\Ajax | Class to handle local json ajax requests to API |
\Vinou\ApiConnector\FileHandler\Images | File handling to store and cache api images in local application |
\Vinou\ApiConnector\FileHandler\Pdf | File handling to store and cache api PDFs in local application |
\Vinou\ApiConnector\Session\Session | Main session class to instantiate, get, set and delete session variables |
\Vinou\ApiConnector\Session\TYPO3Session | Class that is used to use TYPO3 sesions |
\Vinou\ApiConnector\Tools\Helper | Some static helper functions e.g. get api urls depending on environment |
\Vinou\ApiConnector\Tools\Redirect | Helper class to do internal and external redirects |
Provider
This Library is developed by the Vinou GmbH.
Vinou GmbH
Mombacher Straße 68
55122 Mainz
E-Mail: kontakt@vinou.de
Phone: +49 6131 6245390