GBG Developers

sdfsdfsdf

some text

.red { fill: #b0013a; }

Retrieve by ID

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

Retrieve full address details using an ID, of type 'Address', returned from an earlier search call.

Mandatory fields are highlighted
Header Parameters
Name Type Description
Authorization string

A JWT token to allow access

Request Body
  • Example
  • Schema
  • {
    • Id string

      An address ID returned by an earlier 'find' call

    }
{
  "Id": "GB|RM|B|4590068"
}
Response

The data provided was accepted and the identified address is returned

Response Body
  • {
    • lines Array [
      • string
      ]
    • address string

      The full address as a single string.

      example: 128 Queen Victoria Street, London, EC4V 4BJ
    • premise string example: 128
    • building string
    • subBuilding string
    • thoroughfare string example: Queen Victoria Street
    • dependentThoroughfare string
    • locality string example: London
    • dependentLocality string
    • doubleDependentLocality string
    • postalCode string example: EC4V 4BJ
    • postBox string
    • country string

      Country the address is in. It must be a valid ISO2 or ISO3 country code

      example: GBR
    • superAdministrativeArea string
    • administrativeArea string
    • subAdministrativeArea string
    • organization string example: GB Group
    • PCAField {
      }
    }
{
  "lines": {
    "Title": null,
    "Type": "string",
    "Format": null,
    "Description": null,
    "Maximum": null,
    "ExclusiveMaximum": null,
    "Minimum": null,
    "ExclusiveMinimum": null,
    "MaxLength": null,
    "MinLength": null,
    "Pattern": null,
    "MultipleOf": null,
    "Default": null,
    "ReadOnly": false,
    "WriteOnly": false,
    "AllOf": [],
    "OneOf": [],
    "AnyOf": [],
    "Not": null,
    "Required": [],
    "Items": null,
    "MaxItems": null,
    "MinItems": null,
    "UniqueItems": null,
    "Properties": {},
    "MaxProperties": null,
    "MinProperties": null,
    "AdditionalPropertiesAllowed": true,
    "AdditionalProperties": null,
    "Discriminator": null,
    "Example": null,
    "Enum": [],
    "Nullable": false,
    "ExternalDocs": null,
    "Deprecated": false,
    "Xml": null,
    "Extensions": {},
    "UnresolvedReference": false,
    "Reference": null
  },
  "address": {
    "PrimitiveType": 4,
    "AnyType": 0,
    "Value": "128 Queen Victoria Street, London, EC4V 4BJ"
  },
  "premise": {
    "PrimitiveType": 4,
    "AnyType": 0,
    "Value": "128"
  },
  "building": null,
  "subBuilding": null,
  "thoroughfare": {
    "PrimitiveType": 4,
    "AnyType": 0,
    "Value": "Queen Victoria Street"
  },
  "dependentThoroughfare": null,
  "locality": {
    "PrimitiveType": 4,
    "AnyType": 0,
    "Value": "London"
  },
  "dependentLocality": null,
  "doubleDependentLocality": null,
  "postalCode": {
    "PrimitiveType": 4,
    "AnyType": 0,
    "Value": "EC4V 4BJ"
  },
  "postBox": null,
  "country": {
    "PrimitiveType": 4,
    "AnyType": 0,
    "Value": "GBR"
  },
  "superAdministrativeArea": null,
  "administrativeArea": null,
  "subAdministrativeArea": null,
  "organization": {
    "PrimitiveType": 4,
    "AnyType": 0,
    "Value": "GB Group"
  },
  "PCAField": {}
})

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 '{
  "Id": "GB|RM|B|4590068"
}' \
"https://api.addressy.com/Address/Capture/Retrieve/v1.0/json4.ws"
var data = JSON.stringify({
  "Id": "GB|RM|B|4590068"
});
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/Retrieve/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/Retrieve/v1.0/json4.ws");
message.Headers.Add("Authorization", "Bearer {Authorization}");
message.Content = new StringContent("{\r\n  \"Id\": \"GB|RM|B|4590068\"\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/Retrieve/v1.0/json4.ws';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = '{
  "Id": "GB|RM|B|4590068"
}';
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/Retrieve/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.