BoxLang 🚀 A New JVM Dynamic Language Learn More...

DHL Parcel UK CFML

v0.1.2 Modules

DHL Parcel UK CFML

DHL Parcel UK CFML provides a wrapper for the DHL Parcel UK Web Services. At present, the module only includes access to the DHL sftp service for scans and proof of delivery. Further updates may include access to other DHL Parcel UK APIs.

Installation

box install dhl-parcel-uk-cfml

Examples

Check out the /examples folder for an example implementation.

Usage

The DHL Parcel UK CFML wrapper currently consists of a single models, to manage connection to the DHL SFTP server to download and process event files. The wrapper may be used standalone, or as a ColdBox module.

Standalone

	DHLUKTracking = new models.trackingFTP(
			sftpUsername 	= 'XXXXXXXX'
		,	sftpKeyFile 	= 'path/to/keyfile.ppk'
	);

ColdBox

DHLUKTracking 	= getInstance("trackingFTP@DHLParcelUKCFML");

alternatively inject it directly into your handler

property name="DHLUKTracking" inject="trackingFTP@DHLParcelUKCFML";

When using with ColdBox, you'll want to insert your API authentication details into your module settings:

DHLUKCFML = {
		sftpUsername 	= getSystemSetting("DHLUK_SFTPUSERNAME", "")
	,	sftpKeyfile 	= getSystemSetting("DHLUK_SFTPKEYFILE_PATH", "")
}

Retrieve tracking event data

Tracking event files are uploaded to the DHL SFTP server every 20 minutes or so. The events component can be used to list, download and process these files.

fileList = DHLUKEvents.getFileList();
fileContents = DHLEvents.processRemoteFiles(
		dateRange 			= '2021-01-01,2021-01-31'
	,	removeFromServer 	= false
);

Author

Written by Gary Stanton.
https://garystanton.co.uk

$ box install dhl-parcel-uk-cfml

No collaborators yet.
 
  • {{ getFullDate("2021-06-30T11:33:51Z") }}
  • {{ getFullDate("2021-06-30T12:10:32Z") }}
  • 1,003
  • 13