Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

uwolfer/swiss-post-address-verification-java-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swiss-post-address-verification-java-client

Build Status Release

A lightweight Java client implementation without application server dependencies of the free Swiss Post address verification API.

Getting Started

These instructions will get you ready to use this library.

Prerequisites

This library depends on Java 7 or later. There are no more runtime dependencies.

You need a Swiss Post business account (can be registered for free) in order to use the API. You can find contact information on the Swiss Post website in order to request a full documentation of the API (you won't be able to use this library without the official documentation!).

Installing

You can add this library to your project as dependency with Gradle:

repositories {
    maven { url "https://jitpack.io" }
}
dependencies {
    compile 'com.github.uwolfer:swiss-post-address-verification-java-client:2.0.1'
}

Or with Maven:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.github.uwolfer</groupId>
    <artifactId>swiss-post-address-verification-java-client</artifactId>
    <version>2.0.1</version>
</dependency>

Using

String endpointUrl = "https://webservices.post.ch/copy-path-from-documentation";
String userName = "TU_YOUR_ID";
String password = "your-password";
AddressVerificationClient addressVerificationClient = new AddressVerificationClient(endpointUrl, userName, password);

AddressVerificationRequest req = new AddressVerificationRequest();
req.setNames("First Last");
req.setStreet("Bahnhofstrasse");
req.setHouseNbr("1");
req.setZip("8001");
req.setTown("Zürich");

AddressVerificationResponse resp = addressVerificationClient.callWebService(req);
AddressVerificationResponse.Rows row = resp.getRows().get(0);
System.out.println(String.format("House Key: %s, Guaranteed Delivery: %s", row.getHouseKey(), row.getGuaranteedDelivery()));
// output: House Key: 57000040, Guaranteed Delivery: 2

Versioning

This library uses SemVer for versioning.

Authors

  • Urs Wolfer - Maintainer

License

This project is released under the Apache 2.0 license - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages