PHP code example of ecomailcz / webareal-client

1. Go to this page and download the library: Download ecomailcz/webareal-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ecomailcz / webareal-client example snippets



$username = '<vaše přihlašovací jméno>';
$password = '<vaše přihlašovací heslo>';
$apiKey = '<váš API klíč>';

$credentials = new \Ecomailcz\Webareal\Credentials($username, $password, $apiKey); 
$api = new \Ecomailcz\Webareal\Client($credentials);

$orders = $api->requestGet('orders', [
    'limit' => 10,
    'sortBy'=>'id',
    'sortDirection'=>'desc'
]);


$cache = new \Ecomailcz\Webareal\TokenCache\FileCache(__DIR__ . '/temp');
$api = new \Ecomailcz\Webareal\Client($credentials, $cache);