creatissimo/dhl-oauth

This API describes how API client can obtain a token which is used to access various Parcel Germany APIs. Using this API is often the first step in making your API call. <p><h3>Preconditions</h3> You will need: * client ID (aka "API Key", obtained when you create an app in developer.dhl.com) * clie

Maintainers

Package info

github.com/creatissimo/dhl-oauth

Homepage

pkg:composer/creatissimo/dhl-oauth

Statistics

Installs: 15

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-06-02 14:21 UTC

This package is auto-updated.

Last update: 2026-06-02 14:25:40 UTC


README

This API describes how API client can obtain a token which is used to access various Parcel Germany APIs. Using this API is often the first step in making your API call.

Preconditions

You will need:
  • client ID (aka "API Key", obtained when you create an app in developer.dhl.com)
  • client secret (aka "API Secret", obtained when you create an app in developer.dhl.com)
  • GKP user name (obtained when setting up your business account with Parcel Germany)
  • GKP password (obtained when setting up your business account with Parcel Germany)

Technical Information

This uses an implementation of OAuth2 Password Grant (RFC 6749). After successfull usage you will: * have an opaque access token to be used for API calls afterwards * this token will have an expiration time

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

Getting Started

Please follow the installation procedure and then run the following:

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




$apiInstance = new DHLOauth\Client\Api\AuthenticationApi(
    // 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()
);
$grant_type = 'grant_type_example'; // string
$username = 'username_example'; // string | GKP user name. Required for grant_type=password.
$password = 'password_example'; // string | GKP password. Required for grant_type=password.
$client_id = 'client_id_example'; // string
$client_secret = 'client_secret_example'; // string

try {
    $result = $apiInstance->dispenseToken($grant_type, $username, $password, $client_id, $client_secret);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->dispenseToken: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api-sandbox.dhl.com/parcel/de/account/auth/ropc/v1

Class Method HTTP request Description
AuthenticationApi dispenseToken POST /token Obtains an access token based on the credentials submitted or based on the refresh token.
BusinessOperationsApi hello GET /hello This allows testing of the token and also alternative authentication methods.
GeneralApi getSemanticVersion GET / Return API version

Models

Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication (Apigee)

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

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

  • API version: 2.0.5
    • Generator version: 7.22.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen