Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garystanton/dhl-parcel-uk-cfml
https://github.com/garystanton/dhl-parcel-uk-cfml
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/garystanton/dhl-parcel-uk-cfml
- Owner: GaryStanton
- License: mit
- Created: 2021-06-28T11:04:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-30T12:10:39.000Z (over 3 years ago)
- Last Synced: 2024-05-16T16:58:12.335Z (6 months ago)
- Language: ColdFusion
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```js
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
```cfc
DHLUKTracking = new models.trackingFTP(
sftpUsername = 'XXXXXXXX'
, sftpKeyFile = 'path/to/keyfile.ppk'
);```
### ColdBox
```cfc
DHLUKTracking = getInstance("trackingFTP@DHLParcelUKCFML");
```
alternatively inject it directly into your handler
```cfc
property name="DHLUKTracking" inject="trackingFTP@DHLParcelUKCFML";
```When using with ColdBox, you'll want to insert your API authentication details into your module settings:
```cfc
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.```cfc
fileList = DHLUKEvents.getFileList();
``````cfc
fileContents = DHLEvents.processRemoteFiles(
dateRange = '2021-01-01,2021-01-31'
, removeFromServer = false
);
```## Author
Written by Gary Stanton.
https://garystanton.co.uk