Lookup

Edited

Overview

The Lookup endpoint is used to retrieve a complete address using parameters returned from an API call to another endpoint such as Autocomplete or Drilldown.

Please read API Overview first.

API Endpoint

https://api.autoaddress.com/3.0/lookup

Request

Please note: It is not possible to construct your own Lookup requests. Attempts to use a manually constructed Lookup request will result in a HTTP error. 

Input Fields

Name

Type

Description

token*

string

Access token from Create Token endpoint

sig*

string

Signature returned from previous API call

aa3id*

string

Autoaddress ID for the Lookup

country

string

Country to limit results to

language

string

Language to return result in

* Required Field

The following is an example cURL Lookup call.

curl --location 'https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE'

Response

The following is a sample JSON response returned for a Lookup API request.

{
    "type": "lookup",
    "message": {
        "id": 100,
        "language": "en",
        "value": "Address Found"
    },
    "address": {
        "id": "IE1900166318",
        "language": "en",
        "charset": "Latn",
        "lines": [
            {
                "key": "AddressLine1",
                "value": "Unit 109"
            },
            {
                "key": "AddressLine2",
                "value": "Block A, Dublin Airport Business Park, Swords Road"
            }
        ],
        "city": {
            "value": ""
        },
        "region": {
            "value": "Dublin 9"
        },
        "postcode": {
            "value": "D09 CT96"
        },
        "country": {
            "language": "en",
            "value": "Ireland",
            "iso": "IE"
        },
        "label": [
            [
                "Unit 109"
            ],
            [
                "Block A, Dublin Airport Business Park, Swords Road"
            ],
            [
                "Dublin 9"
            ],
            [
                "D09 CT96"
            ]
        ]
    },
    "data": {},
    "links": [
        {
            "rel": "self",
            "href": "https://api.autoaddress.com:443/3.0/lookup?aa3Id=IE1900166318_Latn_en_V&sig=c5ac4d1fcfc95ed68bad4f33af3eca5d&token=fvBby7sc9D+oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ+Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D",
            "title": "self"
        },
        {
            "rel": "autoaddressformlayout",
            "href": "https://api.autoaddress.com/3.0/autoaddressformlayout?token=fvBby7sc9D%20oGwJKa6f83sMca6oNynj2ehtH5P%2FmQpHfFpqemQ%20Ge17P1lVmboVXUauDn07Z8MjLx4%2FZBhW0wQ%3D%3D&selectedCountry=IE&selectedLanguage=en&sig=0aa0d0290b930c76556fa180f0843ade",
            "title": "autoaddressformlayout"
        }
    ]
}

Output Fields

Name

Type

Description

type

string

Name of the response type

message

Message

A Message object (described below)

address

Address

An Address object (described below)

data

dynamic

Dynamic field containing customer specific data

links

Link[]

An array of Link objects (described below)

Address Object

Name

Type

Description

id

string

Autoaddress ID of the address

language

string

Primary language for the address

charset

string

Character set the address is in

lines

Value[]

Key/value pairs for each line of the address

city

Value

Value object containing the city the address is located in

region

Value

Value object containing the region the address is located in

postcode

Value

Value object containing the post code associated with the address

country

Country

A Country object (described below)

label

string[]

An array of labels containing each part of the address

Value Object

Name

Type

Description

key

string

Key of the object

value

string

Value of the object

Country Object

Name

Type

Description

language

string

Primary language of the country

value

string

Name of the country

iso

string

ISO code for the country

Message Object

Name

Type

Description

id

int

Message ID

language

string

Language of the message

value

string

Value of the message

Link Object

Name

Type

Description

rel

string

Type of link

href

string

The hyperlink the client should follow is stored in the value of this property

title

string

Display name of the link

Examples

jQuery

var settings = {
  "url": "https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE",
  "method": "GET",
  "timeout": 0,
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Ruby

require "uri"
require "net/http"

url = URI("https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
<code data-language="ruby"><code data-language="ruby"><code data-language="ruby">request["User-Agent"] = "Ruby application" </code></code></code>

response = https.request(request)
puts response.read_body

Python

import requests

url = "https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE"

payload = {}
headers = {
  'User-Agent': 'Python application'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

C#

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.autoaddress.com/3.0/lookup?aa3Id=AA3_ID&token=YOUR_TOKEN&sig=SIGNATURE");
request.Headers.Add("User-Agent", ".NET application");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());