mydhl
1.0.0
OpenAPI description for the Integration with MyDHL
This PHP package is automatically generated by the OpenAPI Generator project:
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/spysystem/mydhl.git"
}
],
"require": {
"spysystem/mydhl": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: BasicAuth
$config = MyDHLConfiguration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MyDHLApiDHLClientApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
$data = new MyDHLModelRateRequestRequest(); // MyDHLModelRateRequestRequest | Rate Request Data
try {
$result = $apiInstance->requestRate($data);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DHLClientApi->requestRate: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to https://wsbexpress.dhl.com/rest/sndpt
Class | Method | HTTP request | Description |
---|---|---|---|
DHLClientApi | requestRate | POST /RateRequest | Requests a Shipment Rate |
DHLClientApi | requestShipment | POST /ShipmentRequest | Create a Shipment |