GetData

Overview

The Get Data endpoint is used to retrieve additional information about an address. The additional data is customer specific.

Please read API Overview first.

API Endpoint

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

Request

To retrieve GetData results, a simple  GET request from your desired language is all that is needed.

The request must be authenticated. Please see the API Authentication documentation for full details.

Note: This API is intended to be called by backend servers. To ensure this, it is necessary for the IP address of that server to be set in the Account Centre. This can be done by following the steps here.

Input Fields

NameTypeDescription
token*stringAccess token from Create Token endpoint
addressId*stringID of the address
dataTypesstring[]Names of the additional data objects to be returned

* Required Field

Note: If no dataType is passed, the API will look to what dataTypes are set on the Integration on the Account Centre.

cURL

curl --location 'https://api.autoaddress.com/3.0/getdata?token=YOUR_TOKEN&addressId=ADDRESS_ID&dataType=YOUR_DATA_TYPE'

Response

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

{
    "type": "getdata",
    "message": {
        "id": 100,
        "language": "en",
        "value": "Address Data Found"
    },
    "addressId": "IE1900166318",
    "data": {},
    "links": [
        {
            "rel": "self",
            "href": "https://localhost:443/3.0/getdata?token=k9nmH5Exyzfao3ScZPDnbIbpBCEXNsvrnhuIlJMK%2F4oI3V85OoVt7z8V2MWFHuYaessbRLZYbD0iIFABGe2uVQ%3D%3D&addressId=IE1900166318&dataType=location",
            "title": "self"
        }
    ]
}

Output Fields

NameTypeDescription
typestringName of the response type
messageMessageA Message object (described below)
addressIdstringAddress ID of the address
datadynamicDynamic field containing customer specific data
linksLink[]An array of Link objects (described below)

Message Object

NameTypeDescription
idintMessage ID
languagestringLanguage of the message
valuestringValue of the message

Link Object

NameTypeDescription
relstringType of link
hrefstringThe hyperlink the client should follow is stored in the value of this property
titlestringDisplay name of the link

Examples

jQuery

var settings = {
  "url": "https://api.autoaddress.com/3.0/getdata?token=YOUR_TOKEN&addressId=ADDRESS_ID&dataType=YOUR_DATA_TYPE",
  "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/getdata?token=YOUR_TOKEN&addressId=ADDRESS_ID&dataType=YOUR_DATA_TYPE")

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

request = Net::HTTP::Get.new(url)
request["User-Agent"] = "Ruby application" 

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

Python

import requests

url = "https://api.autoaddress.com/3.0/getdata?token=YOUR_TOKEN&addressId=ADDRESS_ID&dataType=YOUR_DATA_TYPE"

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/getdata?token=YOUR_TOKEN&addressId=ADDRESS_ID&dataType=YOUR_DATA_TYPE");
request.Headers.Add("User-Agent", ".NET application");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());