Skip to content

A library to perform domestic post code searches with Australia Post using their API

License

Notifications You must be signed in to change notification settings

ashri/java-auspost-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Client for the Australia Post Postcode Search API

A Java library providing a client for the Australia Post APIs. At this stage only the Postcode Search service is implemented.

Basic Usage

   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.

Building the Java Australia Post API client

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.

Using the library in your project

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

Copyright (c) 2015 Ashley Richardson. See LICENSE for details.

About

A library to perform domestic post code searches with Australia Post using their API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages