/mydhl

DHL Express MyDHL service

Primary LanguagePHP

OpenAPIClient-php

OpenAPI description for the Integration with MyDHL

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit http://spysystem.dk

Requirements

PHP 5.5 and later

Installation & Usage

Composer

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

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure HTTP basic authorization: BasicAuth
$config = MyDHL\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new MyDHL\Api\DHLClientApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$data = new \MyDHL\Model\RateRequestRequest(); // \MyDHL\Model\RateRequestRequest | Rate Request Data

try {
    $result = $apiInstance->requestRate($data);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DHLClientApi->requestRate: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

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

Documentation For Models

Documentation For Authorization

BasicAuth

  • Type: HTTP basic authentication

Author

thomas@spysystem.dk