1. Go to this page and download the library: Download dpdconnect/php-sdk 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/ */
dpdconnect / php-sdk example snippets
use DpdConnect\Sdk\ClientBuilder;
$clientBuilder = new ClientBuilder();
// Authenticate by username + password (JWT is fetched automatically)
$client = $clientBuilder->buildAuthenticatedByPassword('your-username', 'your-password');
// Or authenticate with an existing JWT token
$client = $clientBuilder->buildAuthenticatedByJwtToken('your-jwt-token');
// List parcelshops near a location
$parcelshops = $client->getParcelshop()->getList([
'longitude' => 4.9041,
'latitude' => 52.3676,
'countryIso' => 'NL',
'limit' => 10,
]);
// Get a specific parcelshop by ID
$parcelshop = $client->getParcelshop()->get('NL10566');
// For staging or self-hosted environments
$clientBuilder = new ClientBuilder('https://api.staging.dpdconnect.nl');
$client = $clientBuilder->buildAuthenticatedByPassword('username', 'password');