A Java library providing a client for the Australia Post APIs. At this stage only the Postcode Search service is implemented.
PostcodeSearchClient client = new PostcodeSearchClient(apiKey);
SearchResponse response = client.prepareSearch(q).executeGet();
The Client requires an API key, which Australia Post provides, in order to
successfully make requests. The API key must be configured as a System
property (-D
) under the name AusPostApiKey
.
More examples using the library can be seen in the unit tests.
A Maven POM is provided with the library. The Java8 SDK is required to build and use the library.
To build and install the library:
mvn install
By default, the PostcodeSearchClientTest
which actually executes against the
remote API is @Ignored
and an API key is required to run the tests.
The release versions of the library are deployed to Github which means you will need to add a repository to your Maven POM:
<repositories>
<repository>
<id>auspost-mvn-repo</id>
<url>https://raw.github.com/ashri/auspost-api/mvn-repo/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
You can then reference the library as a dependency using the following:
<dependencies>
<dependency>
<groupId>com.threeheadedmonkey.auspost</groupId>
<artifactId>auspost-postcode-search</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
Copyright (c) 2015 Ashley Richardson. See LICENSE for details.