DHL API Track and Capability Handler


DHL has an API to make automatize the whole cargo process. I had an article about DHL Labeling utility. Well actually I found it to pull through here as an article series since DHL documentations are really complicated and long to read.

The code below depict example tracking handling utility and request. The response is a long piece of XML.

The minidom package for python 3 parses the Airway Bill Number XML. Be sure that you have downloaded and put the XML files under your file system. I found it easy-peasy to make requests upon editing this files with minidom parser.

The  URL is for testing purposes. Please replace the necessary URL when you are running on the production. Bear in mind this example explanatory article is for Python 3 with minidom package installed within.

Capabılıty handler

Capability handler or namely the handler when you want to query local and global product codes, this piece of code takes the role.

There is no need to edit the file on run time via Python. Just make a request to XML PI with parsing the file.

That is it!

Hope you find this article useful for your potential work-scale.

Happy coding!

About the author

Anil Bektas

Reader/Writer. Founder of Diary of Coders.

By Anil Bektas


Recent Posts

Recent Comments



Anil Bektas

Reader/Writer. Founder of Diary of Coders.

Get in touch

Links to my social media accounts. Thank you for following!

Tag Cloud