PHP code example of webit / gls-ade

1. Go to this page and download the library: Download webit/gls-ade 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/ */

    

webit / gls-ade example snippets


use Webit\GlsAde\Model\AdeAccount;
use \Webit\GlsAde\Api\Factory\ApiFactory;

$adeAccount = new AdeAccount('your-login', 'your-password', 'is-test-env' ? true : false);

$apiFactory = ApiFactory::create();

/** @var \Webit\GlsAde\Api\AuthApi $authApi */
$authApi = $apiFactory->createAuthApi();

/** @var \Webit\GlsAde\Api\ConsignmentPrepareApi $consignemntPrepareApi */
$consignemntPrepareApi = $apiFactory->createConsignmentPrepareApi($adeAccount);

/** @var \Webit\GlsAde\Api\MpkApi $mpkApi */
$mpkApi = $apiFactory->createMpkApi($adeAccount);

/** @var \Webit\GlsAde\Api\PickupApi $pickupApi */
$pickupApi = $apiFactory->createPickupApi($adeAccount);

/** @var \Webit\GlsAde\Api\PostalCodeApi $postalCodeApi */
$postalCodeApi = $apiFactory->createPostalCodeApi($adeAccount);

/** @var \Webit\GlsAde\Api\ProfileApi $profileApi */
$profileApi = $apiFactory->createProfileApi($adeAccount);

/** @var \Webit\GlsAde\Api\SenderAddressApi $senderAddressApi */
$senderAddressApi = $apiFactory->createSenderAddressApi($adeAccount);

/** @var \Webit\GlsAde\Api\ServiceApi $serviceApi */
$serviceApi = $apiFactory->createServiceApi($adeAccount);
sh
cd examples
cp config.php.dist config.php