Download the PHP package gregpunla/dhl_api without Composer
On this page you can find all versions of the php package gregpunla/dhl_api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gregpunla/dhl_api
More information about gregpunla/dhl_api
Files in gregpunla/dhl_api
Package dhl_api
Short Description PHP library to communicate with the DHL XML Services.
License LGPL-2.1
Informations about the package dhl_api
Authors & contact
Al-Fallouji Bashar
License
Description
This library is a PHP Oriented Object client for the DHL XML API Services. DHL XML Services is an online web services integration capability that provides DHL’s service availability, transit times, rates, shipment and courier pickup booking along with shipment tracking from over 140 countries around the world. Using DHL’s XML Services, customers can incorporate DHL shipping functionality into their websites, customer service applications or order processing systems.
Setup
You can use composer to use this library.
Usage
This client does not rely or depend on any framework and it should be fairly easy to integrate with your own code. You can use the autloader that is provided or your own autoloading mechanism.
The sample folder contains examples on how to use the client and perform requests to DHL XML API, such as track a shipment, create a shipment, request a pickup or print labels.
In order to have the samples working, you will need to create a DHL staging account. You can do that by going to that URL : http://www.dhl.com.au/en/express/resource_center/integrated_shipping_solutions/integrating_xml_services.html
Then, you need to copy the conf/config.sample.php to conf/config.php (that file is loaded init.php). You need to edit the dhl settings defined in the config/config.php file and provide your account id and password. The samples use those credentials.
Example
Request a shipment
How to display or store the PDF label ?
The label is encoded using base64 encoding.
If you would like to get the binary version in order to store it as .PDF or to display it on the browser, you will need to decode it.
For example, the image label is returned in the LabelImage->OutputImage node.
In PHP, you will need to do the following in order to decode the string.
How to get quotations for a shipment ?
You can use the getQuote or getCapability service for that. Here is an example.