GBG Developers

sdfsdfsdf

some text

.red { fill: #b0013a; }

Address Search

Post https://api.addressy.com/Address/Capture/Find/v1.0/json4.ws

Search for addresses using entered data. This should be used iteratively, a basic call is made using the initial input string (see 'Simple' example). Further calls can then be made using an ID returned from a previous call where the type is not 'Address'. This should be passed in the the Container field. (see 'Drilldown' example)

Mandatory fields are highlighted
Header Parameters
Name Type Description
Authorization string

A JWT token to allow access

Request Body
  • Example
  • Schema
  • {
    • Text string

      The search text to find. Ideally a postcode or the start of the address.

      example: Albert Dock
    • IsMiddleware boolean

      Whether the API is being called from a middleware implementation (and therefore the calling IP address should not be used for biasing).

      example: false
    • Container string

      A limiting container for the search. This should only be an Id returned from a previous call to this service when the Type of the result was not 'Address'.

      example: GB|RM|ENG|HULL---DOCK-ALBERT
    • Origin string

      A starting location for the search. This can be an ISO 2 or 3 character code of a country, WGS84 coordinates (comma separated) or an IP address to search from.

    • Countries string

      A comma separated list of ISO 2 or 3 character country codes to limit the search.

      example: GBR, FR, US
    • Limit integer

      The maximum number of results to return.

    • Language string

      The preferred language for results. This should be a 2 or 4 character language code

      example: fr, en-gb, en-us
    }
{
  "Text": "WR5 3DA"
}
{
  "Text": "29 Wycliffe Court",
  "Container": "GB|RM|ENG|3HA-CH2"
}
Response

The data provided was accepted and the matching results are returned

Response Body
  • [
    • {
      • Id string

        This can be an address Id or a container Id for further results.

        example: GB|RM|ENG|3HA-CH2
      • Type string

        If the Type is 'Address' then the Id can be passed to the retrieve service. Any other Id should be passed as the Container to a further find request to get more results.

        example: BuildingName
      • Text string

        The name of the result.

        example: Albert Dock 17A, New Wharf Road
      • Highlight string

        A list of number ranges identifying the matched characters in the Text and Description.

        example: 0-6,7-11
      • Description string

        Descriptive information about the result.

        example: Liverpool, L3 - 203 Addresses
      }
    ]
{})

BadRequest

Response Body
  • [
    • {
      • Error string example: 1001
      • Description string example: Text or Container Required
      • Cause string example: The Text or Container parameters were not supplied.
      • Resolution string example: Check they are supplied and try again.
      }
    ]
{})

Unauthorized

Response Body
  • [
    • {
      • Error string example: 1001
      • Description string example: Text or Container Required
      • Cause string example: The Text or Container parameters were not supplied.
      • Resolution string example: Check they are supplied and try again.
      }
    ]
{})

Internal Server Error

Response Body
  • [
    • {
      • Error string example: 1001
      • Description string example: Text or Container Required
      • Cause string example: The Text or Container parameters were not supplied.
      • Resolution string example: Check they are supplied and try again.
      }
    ]
{})
  • cURL
  • JavaScript
  • C#
  • PHP
  • Java (Spring)
curl -X POST \
 - H 'Authorization: Bearer {Authorization}' \
 - H 'Content-Type: application/json' \
    -d '{
  "Text": "WR5 3DA"
}' \
"https://api.addressy.com/Address/Capture/Find/v1.0/json4.ws"
var data = JSON.stringify({
  "Text": "WR5 3DA"
});
var xhr = new XMLHttpRequest();
xhr.addEventListener('readystatechange', function () {
    if (this.readyState === this.DONE) {
        console.log(this.responseText);
    }
});
xhr.open('Post', 'https://api.addressy.com/Address/Capture/Find/v1.0/json4.ws');
xhr.setRequestHeader('Authorization', 'Bearer {Authorization}');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(data);
var client = new HttpClient();
var message = new HttpRequestMessage(HttpMethod.Post, "https://api.addressy.com/Address/Capture/Find/v1.0/json4.ws");
message.Headers.Add("Authorization", "Bearer {Authorization}");
message.Content = new StringContent("{\r\n  \"Text\": \"WR5 3DA\"\r\n}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(message);
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
$url = 'https://api.addressy.com/Address/Capture/Find/v1.0/json4.ws';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = '{
  "Text": "WR5 3DA"
}';
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(     
    'Authorization: Bearer {Authorization}',
    'content-type: application/json',
    'Content-Length: ' . strlen($data))
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
$json = json_decode($response, true);
curl_close($ch);
print_r($json);
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", "Bearer {Authorization}");
String body = "<JSON BODY>";
HttpEntity<String> request = new HttpEntity<>(body, headers);
String host = "https://api.addressy.com/Address/Capture/Find/v1.0/json4.ws";
//restTemplate should be autowired via constructor of this class
ResponseEntity<String> response = restTemplate.postForEntity(host, request, String.class);
if (200 == response.getStatusCodeValue()){
    //DO STUFF
}

Remember! Each of the marked variables should be replaced with your credentials or your chosen options.