Getting Started with the API

Consuming the Autoaddress 3.0 API is easy, simply follow the steps blelow.

Get a Token

You will first need to authenticate the session to create a token using the createtoken endpoint. To call this endpoint, you will need to pass a valid API key.

See the Create Token documentation for full details.

Search for an Address

When the end user is typing, each keystroke is passed to the autocomplete endpoint. As the end user continues to type, keep calling autocomplete, passing the entered text and the same token from step 1.

See the Autocomplete documentation for full details.

Display the Options

Each autocomplete call will return an array options and each would contain a link object. The link object contains two important attributes:

  1. title - The address text to be displayed to the end user
  2. href - The hyperlink to follow if this option is chosen

You will need to show the link.title attribute for each element of the options array to the end-user. Once you have displayed the available options, the end-user will need to select one.

Follow the Link

Each option returned has a href attribute which will invoke another endpoint.

There are two endpoints that this attribute can call to:

  1. Lookup Endpoint - This will return the fully captured address
  2. Drilldown Endpoint - This will return further options

When the attribute invokes the drilldown endpoint, there are still options to display. These options should continue to be displayed until the end-user selects a full address and then the attribute will call the lookup endpoint.

See the Drilldown documentation for full details.

Capture the Data

When the type attribute equals "lookup", you can access details of the address using the "address" attribute. 

For any further info you have selected in the Account Center, you can access this data via the "data" attribute in the response.

See the Lookup and GetData documentation for full details.