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
Name | Type | Description |
---|---|---|
token* | string | Access token from Create Token endpoint |
addressId* | string | ID of the address |
dataTypes | string[] | 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
Name | Type | Description |
---|---|---|
type | string | Name of the response type |
message | Message | A Message object (described below) |
addressId | string | Address ID of the address |
data | dynamic | Dynamic field containing customer specific data |
links | Link[] | An array of Link objects (described below) |
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/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());