MaurizioPz / MyDHL-API-Reference-Implementation

Showing you how to use MyDHL API in a .NET project using best practices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This project is a reference implementation of MyDHL API in .NET.

This project includes:

  • A library for RESTful MyDHL API operations
  • A test application for all MyDHL API operations

This project will include (at a later date):

  • A library for SOAP MyDHL API operations (work in progress)

Please note that this is all a work in progress. This message will be removed when all components reach v1.0 state

RESTful Library

Implemented RESTful Operations

  • Rate Query
  • Shipment Generation
  • Pickup Request
  • Cancel/Delete Pickup
  • Tracking
  • ePOD Retrieve

Pending RESTful Operations

  • Update Shipment

SOAP Library

Implemented SOAP Operations

--none--

Pending SOAP Operations

  • Rate Query
  • Shipment Generation
  • Update Shipment
  • Pickup Request
  • Cancel/Delete Pickup
  • Tracking
  • ePOD Retrieve

Usage

Requirements

To use the test app, you must create a credentials.txt and ensure that it is included while building. This file should contain your username on line 1 and your password on line 2. Do not include this in source control if you intent to publish to the Internet.

You also have the option to use the defaults.json file to set default values which all forms in the test app will use to pre-populate the form (saving your time). Do not include this in source control if you intend to publish to the Internet.

A defaults-example.json file is included for your reference.

Example

Instantiate the MyDHLAPI object

MyDHLAPI myDHLAPI = new MyDHLAPI(username, password, baseURL);

Call the appropriate method (tracking as an example)

resp = myDHLAPI.KnownAWBTracking(new List<string>() { "1234567891" }
                                 , Enums.LevelOfDetails.AllCheckpoints
                                 , Enums.PiecesEnabled.Both
                                 , Enums.EstimatedDeliveryDateEnabled.Yes);

About

Showing you how to use MyDHL API in a .NET project using best practices

License:MIT License


Languages

Language:C# 100.0%