PHP code example of magentix / unopim-php-api-client
1. Go to this page and download the library: Download magentix/unopim-php-api-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/ */
magentix / unopim-php-api-client example snippets
$apiUrl = 'https://www.example.com';
$clientId = '1a1b1c1d-2e2f-3g3h-4i4j-5k5l5m5n5o5p';
$clientSecret = '1a3b5c7d9e2f4g6h8i1j3k5l7m9n2o4p6q8r1s3t';
$username = '[email protected]';
$password = 'Password';
$cache = new \Magentix\UnoPimApiClient\UnoPimApiCache(
__DIR__ . DIRECTORY_SEPARATOR . 'api_cache', // The cache file directory path
86400 // Request lifetime in seconds (GET requests in HTTP 200 are cached, 0 to disable)
);
$client = new \Magentix\UnoPimApiClient\UnoPimApiClient(
$apiUrl,
$clientId,
$clientSecret,
$username,
$password,
$cache,
3000 // Authentication lifetime (need to be lower that the access token TTL, 0 to disable)
);