Sample: JSON

POST Request

The following is an example of a JSON POST request for the Reverse Geocode Basic, Advanced, Premium service.

BASIC:

Request

{
    "preferences": {
        "returnAllCandidateInfo": true,
        "fallbackToGeographic": true,
        "fallbackToPostal": true,
        "maxReturnedCandidates": 1,
        "distance": 150,
        "streetOffset": 7,
        "cornerOffset": 7,
        "matchMode": "UNSPECIFIED",
        "clientLocale": "en_US",
        "clientCoordSysName": "epsg:4326",
        "distanceUnits": "METERS",
        "streetOffsetUnits": "METERS",
        "cornerOffsetUnits": "METERS",
        "mustMatchFields": {
            "matchOnAddressNumber": false,
            "matchOnPostCode1": false,
            "matchOnPostCode2": false,
            "matchOnAreaName1": false,
            "matchOnAreaName2": false,
            "matchOnAreaName3": false,
            "matchOnAreaName4": false,
            "matchOnAllStreetFields": false,
            "matchOnStreetName": false,
            "matchOnStreetType": false,
            "matchOnStreetDirectional": false,
            "matchOnPlaceName": false,
            "matchOnInputFields": false
        },
        "returnFieldsDescriptor": {
            "returnAllCustomFields": false,
            "returnMatchDescriptor": false,
            "returnStreetAddressFields": false,
            "returnUnitInformation": false
        },
        "customPreferences": {}
    },
    "points": [
        {
            "country": "AUS",
            "geometry": {
                "type": "point",
                "coordinates": [
                    151.196036,
                    -33.879637
                ],
                "crs": {
                    "type": "name",
                    "properties": {
                        "name": "EPSG:4326"
                    }
                }
            }
        }
    ]
}

Response

{
    "responses": [
        {
            "objectId": "1",
            "totalPossibleCandidates": 1,
            "totalMatches": 1,
            "candidates": [
                {
                    "precisionLevel": 0,
                    "precisionCode": "RG4",
                    "sourceDictionary": "0",
                    "geometry": {
                        "type": "Point",
                        "coordinates": [
                            151.196036,
                            -33.879637
                        ],
                        "crs": {
                            "type": "name",
                            "properties": {
                                "name": "epsg:4326"
                            }
                        }
                    },
                    "address": {
                        "areaName1": "New South Wales",
                        "areaName2": "Sydney",
                        "areaName3": "Sydney",
                        "areaName4": "Ultimo",
                        "country": "AUS",
                        "customFields": {
                            "LANGUAGE": "en",
                            "REVERSE_GEOCODE_DISTANCE": "0.0",
                            "REVERSE_GEOCODE_DISTANCE_UNIT": "METERS",
                            "FROM_WORLD_FALLBACK": "true",
                            "RESULT_CODE": "RG4",
                            "GENERIC_FIELD_1": "40996585900100004271"
                        }
                    },
                    "ranges": []
                }
            ]
        }
    ]
}

ADVANCED:

Request

{
    "preferences": {
        "returnAllCandidateInfo": true,
        "fallbackToGeographic": true,
        "fallbackToPostal": true,
        "maxReturnedCandidates": 1,
        "distance": 150,
        "streetOffset": 7,
        "cornerOffset": 7,
        "matchMode": "UNSPECIFIED",
        "clientLocale": "en_US",
        "clientCoordSysName": "epsg:4326",
        "distanceUnits": "METERS",
        "streetOffsetUnits": "METERS",
        "cornerOffsetUnits": "METERS",
        "mustMatchFields": {
            "matchOnAddressNumber": false,
            "matchOnPostCode1": false,
            "matchOnPostCode2": false,
            "matchOnAreaName1": false,
            "matchOnAreaName2": false,
            "matchOnAreaName3": false,
            "matchOnAreaName4": false,
            "matchOnAllStreetFields": false,
            "matchOnStreetName": false,
            "matchOnStreetType": false,
            "matchOnStreetDirectional": false,
            "matchOnPlaceName": false,
            "matchOnInputFields": false
        },
        "returnFieldsDescriptor": {
            "returnAllCustomFields": false,
            "returnMatchDescriptor": false,
            "returnStreetAddressFields": false,
            "returnUnitInformation": false
        },
        "customPreferences": {}
    },
    "points": [
        {
            "country": "AUS",
            "geometry": {
                "type": "point",
                "coordinates": [
                    151.196036,
                    -33.879637
                ],
                "crs": {
                    "type": "name",
                    "properties": {
                        "name": "EPSG:4326"
                    }
                }
            }
        }
    ]
}

Response

{
    "responses": [
        {
            "objectId": "1",
            "totalPossibleCandidates": 1,
            "totalMatches": 1,
            "candidates": [
                {
                    "precisionLevel": 0,
                    "precisionCode": "RG4",
                    "sourceDictionary": "0",
                    "geometry": {
                        "type": "Point",
                        "coordinates": [
                            151.196036,
                            -33.879637
                        ],
                        "crs": {
                            "type": "name",
                            "properties": {
                                "name": "epsg:4326"
                            }
                        }
                    },
                    "address": {
                        "areaName1": "New South Wales",
                        "areaName2": "Sydney",
                        "areaName3": "Sydney",
                        "areaName4": "Ultimo",
                        "country": "AUS",
                        "customFields": {
                            "REVERSE_GEOCODE_DISTANCE": "0.0",
                            "REVERSE_GEOCODE_DISTANCE_UNIT": "METERS",
                            "FROM_WORLD_FALLBACK": "true",
                            "RESULT_CODE": "RG4",
                            "GENERIC_FIELD_1": "40996585900100004271"
                        }
                    },
                    "ranges": []
                }
            ]
        }
    ]
}

PREMIUM:

Request

{
    "preferences": {
        "returnAllCandidateInfo": true,
        "fallbackToGeographic": true,
        "fallbackToPostal": true,
        "maxReturnedCandidates": 1,
        "distance": 150,
        "streetOffset": 7,
        "cornerOffset": 7,
        "matchMode": "UNSPECIFIED",
        "clientLocale": "en_US",
        "clientCoordSysName": "epsg:4326",
        "distanceUnits": "METERS",
        "streetOffsetUnits": "METERS",
        "cornerOffsetUnits": "METERS",
        "mustMatchFields": {
            "matchOnAddressNumber": false,
            "matchOnPostCode1": false,
            "matchOnPostCode2": false,
            "matchOnAreaName1": false,
            "matchOnAreaName2": false,
            "matchOnAreaName3": false,
            "matchOnAreaName4": false,
            "matchOnAllStreetFields": false,
            "matchOnStreetName": false,
            "matchOnStreetType": false,
            "matchOnStreetDirectional": false,
            "matchOnPlaceName": false,
            "matchOnInputFields": false
        },
        "returnFieldsDescriptor": {
            "returnAllCustomFields": false,
            "returnMatchDescriptor": false,
            "returnStreetAddressFields": false,
            "returnUnitInformation": false
        },
        "customPreferences": {}
    },
    "points": [
        {
            "country": "AUS",
            "geometry": {
                "type": "point",
                "coordinates": [
                    151.196036,
                    -33.879637
                ],
                "crs": {
                    "type": "name",
                    "properties": {
                        "name": "EPSG:4326"
                    }
                }
            }
        }
    ]
}

Response

The following shows the JSON response returned by the previous request

{
    "responses": [
        {
            "objectId": "1",
            "totalPossibleCandidates": 2,
            "totalMatches": 2,
            "candidates": [
                {
                    "precisionLevel": 1,
                    "formattedStreetAddress": "368 WATTLE CRESCENT",
                    "formattedLocationAddress": "ULTIMO NSW 2007",
                    "precisionCode": "RS5A",
                    "sourceDictionary": "1",
                    "geometry": {
                        "type": "Point",
                        "coordinates": [
                            151.19611731288958,
                            -33.879601630136534
                        ],
                        "crs": {
                            "type": "name",
                            "properties": {
                                "name": "epsg:4326"
                            }
                        }
                    },
                    "address": {
                        "mainAddressLine": "368 WATTLE CRESCENT",
                        "addressLastLine": "ULTIMO NSW 2007",
                        "areaName1": "NSW",
                        "areaName2": "SYDNEY",
                        "areaName3": "ULTIMO",
                        "postCode1": "2007",
                        "country": "AUS",
                        "addressNumber": "368",
                        "streetName": "WATTLE",
                        "customFields": {
                            "MAIN_ADDRESS": "WATTLE",
                            "LANGUAGE": "en",
                            "StreetDataType": "15",
                            "SEGMENT_ID": "1036100423765",
                            "REVERSE_GEOCODE_DISTANCE": "1.49",
                            "REVERSE_GEOCODE_DISTANCE_UNIT": "METERS",
                            "RESULT_CODE": "RS5A",
                            "THOROUGHFARE_TYPE": "CRESCENT"
                        }
                    },
                    "ranges": [
                        {
                            "lowHouse": "330",
                            "highHouse": "428",
                            "side": "LEFT",
                            "oddEvenIndicator": "EVEN",
                            "units": []
                        }
                    ]
                },
                {
                    "precisionLevel": 1,
                    "formattedStreetAddress": "368 WATTLE STREET",
                    "formattedLocationAddress": "ULTIMO NSW 2007",
                    "precisionCode": "RS5A",
                    "sourceDictionary": "1",
                    "geometry": {
                        "type": "Point",
                        "coordinates": [
                            151.19611731288958,
                            -33.879601630136534
                        ],
                        "crs": {
                            "type": "name",
                            "properties": {
                                "name": "epsg:4326"
                            }
                        }
                    },
                    "address": {
                        "mainAddressLine": "368 WATTLE STREET",
                        "addressLastLine": "ULTIMO NSW 2007",
                        "areaName1": "NSW",
                        "areaName2": "SYDNEY",
                        "areaName3": "ULTIMO",
                        "postCode1": "2007",
                        "country": "AUS",
                        "addressNumber": "368",
                        "streetName": "WATTLE",
                        "customFields": {
                            "MAIN_ADDRESS": "WATTLE",
                            "LANGUAGE": "en",
                            "StreetDataType": "15",
                            "SEGMENT_ID": "1036100423765",
                            "REVERSE_GEOCODE_DISTANCE": "1.49",
                            "REVERSE_GEOCODE_DISTANCE_UNIT": "METERS",
                            "RESULT_CODE": "RS5A",
                            "THOROUGHFARE_TYPE": "STREET"
                        }
                    },
                    "ranges": [
                        {
                            "lowHouse": "330",
                            "highHouse": "428",
                            "side": "LEFT",
                            "oddEvenIndicator": "EVEN",
                            "units": []
                        }
                    ]
                }
            ]
        }
    ]
}