PHP code example of avido / postnl-cif-rest-api-php-client

1. Go to this page and download the library: Download avido/postnl-cif-rest-api-php-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/ */

    

avido / postnl-cif-rest-api-php-client example snippets



use Avido\PostNLCifClient\CifApi;

$apikey = '--YOUR APIKEY --';
$client = new CifApi($apiKey);

use Avido\PostNLCifClient\Request\DeliveryOptions\Locations\NearestLocationsRequest;

// get nearest locations based on address information
$request = new NearestLocationsRequest();
$request->setCountryCode('NL')
    ->setPostalcode('2132WT')
    ->setCity('Hoofddorp')
    ->setStreet('Siriusdreef')
    ->setHouseNumber(42)
    ->setDeliveryDate('01-01-2999')
    ->setOpeningTime('09:00:00')
    ->addDeliveryOptions('PG');
// load api "getAPI" based on 
xml
<phpunit>
  ...
    <php>
        <env name="PHP_APIKEY" value="--YOUR APIKEY--"/>
    </php>
</phpunit>