PHPackages                             vinou/api-connector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. vinou/api-connector

ActiveLibrary[API Development](/categories/api)

vinou/api-connector
===================

Vinou API Connnector

3.4.3(10mo ago)29402GPL-2.0+PHPPHP &gt;=7.2

Since Mar 26Pushed 10mo ago3 watchersCompare

[ Source](https://github.com/vinou-platform/api-connector)[ Packagist](https://packagist.org/packages/vinou/api-connector)[ Docs](https://doc.vinou.de)[ RSS](/packages/vinou-api-connector/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (70)Used By (2)

Vinou API Connector
===================

[](#vinou-api-connector)

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

[](#table-of-contents)

- [Installation](#installation)
- [Usage Example](#usage-example)
    1. [Basic Instantiation](#1-basic-instantiation)
    2. [Instantiation with settings (recommended)](#2-instantiation-with-settings-recommended)
    3. [Improve session handling](#3-improve-session-handling)
    4. [Example function call](#4-example-function-call)
    5. [Prepare Ajax connection](#5-prepare-ajax-connection-content-of-ajaxphp-eg-called-via-httpsyourdomaincomajaxphp)
- [Constants](#constants)
- [Classlist](#classlist)
- [Provider](#provider)

Installation
------------

[](#installation)

```
composer install vinou/api-connector
```

Usage Example
-------------

[](#usage-example)

### 1. Basic instantiation

[](#1-basic-instantiation)

```
$api = new \Vinou\ApiConnector\Api (
        TOKEN_FOR_INSTANCE,
        AUTHID_FOR_VINOU_CUSTOMER
      );
```

### 2. Instantiation with settings (recommended)

[](#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

[](#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

[](#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 )

[](#5-prepare-ajax-connection-content-of-ajaxphp-eg-called-via-httpsyourdomaincomajaxphp)

```
