Example: JSON POST Request & Response
The following is an example of a JSON POST request for the Reverse Geocode service.
POST http://myserver:8080/Geocode/rest/GeocodeService/reverseGeocode.json?
{
"preferences": {
"returnAllCandidateInfo": false,
"fallbackToGeographic": true,
"fallbackToPostal": true,
"maxReturnedCandidates": 1,
"distance": 100,
"streetOffset": 7,
"cornerOffset": 7,
"matchMode": "UNSPECIFIED",
"clientLocale": "en-US",
"clientCoordSysName": "epsg:4326",
"distanceUnits": "METER",
"streetOffsetUnits": "METER",
"cornerOffsetUnits": "METER",
"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,
"returnedCustomFieldKeys": []
},
"customPreferences": {},
"preferredDictionaryOrders": []
},
"points": [
{
"country": "FRA",
"geometry": {
"type": "point",
"coordinates": [
2.294449,
48.85838
],
"crs": {
"type": "name",
"properties": {
"name": "EPSG:4326"
}
}
}
}
]
}
POST http://myserver:8080/rest/GlobalGeocode/reverseGeocode.json?
{
"preferences": {
"returnAllCandidateInfo": false,
"fallbackToGeographic": true,
"fallbackToPostal": true,
"maxReturnedCandidates": 1,
"distance": 100,
"streetOffset": 7,
"cornerOffset": 7,
"matchMode": "UNSPECIFIED",
"clientLocale": "en-US",
"clientCoordSysName": "epsg:4326",
"distanceUnits": "METER",
"streetOffsetUnits": "METER",
"cornerOffsetUnits": "METER",
"mustMatchFields": {
"matchOnAddressNumber": false,
"matchOnPostCode1": false,
...
"matchOnStreetName": false,
"matchOnStreetType": false,
"matchOnStreetDirectional": false,
"matchOnPlaceName": false,
"matchOnInputFields": false
},
"returnFieldsDescriptor": {
"returnAllCustomFields": false,
"returnMatchDescriptor": false,
"returnStreetAddressFields": false,
"returnUnitInformation": false,
"returnedCustomFieldKeys": []
},
"customPreferences": {},
"preferredDictionaryOrders": []
},
"points": [
{
"country": "FRA",
"geometry": {
"type": "point",
"coordinates": [
2.294449,
48.85838
],
"crs": {
"type": "name",
"properties": {
"name": "EPSG:4326"
}
}
}
}
]
}
The following shows the JSON response returned by the previous request.
{
"responses": [
{
"totalPossibleCandidates": 2,
"totalMatches": 2,
"candidates": [
{
"precisionLevel": 2,
"formattedStreetAddress": "avenue Anatole France",
"formattedLocationAddress": "75007 Paris",
"identifier": null,
"precisionCode": "RS4A",
"sourceDictionary": "1",
"matching": null,
"geometry": {
"type": "Point",
"coordinates": [
2.2948623,
48.858486
],
"crs": {
"type": "name",
"properties": {
"name": "epsg:4326"
}
}
},
"address": {
"mainAddressLine": "avenue Anatole France",
"addressLastLine": "75007 Paris",
"placeName": "",
"areaName1": "Ile-de-France",
"areaName2": "Paris",
"areaName3": "Paris",
"areaName4": "7e Arrondissement Paris",
"postCode1": "75007",
"postCode2": "",
"country": "FRA",
"addressNumber": "",
"streetName": "Anatole France",
"unitType": null,
"unitValue": null,
"customFields": {
"REVERSE_GEOCODE_DISTANCE_UNIT": "METER",
"REVERSE_GEOCODE_DISTANCE": "23.3"
}
},
"ranges": []
},
{
"precisionLevel": 2,
"formattedStreetAddress": "parc du Champ de Mars",
"formattedLocationAddress": "75007 Paris",
"identifier": null,
"precisionCode": "RS4A",
"sourceDictionary": "1",
"matching": null,
"geometry": {
"type": "Point",
"coordinates": [
2.2948623,
48.858486
],
"crs": {
"type": "name",
"properties": {
"name": "epsg:4326"
}
}
},
"address": {
"mainAddressLine": "parc du Champ de Mars",
"addressLastLine": "75007 Paris",
"placeName": "",
"areaName1": "Ile-de-France",
"areaName2": "Paris",
"areaName3": "Paris",
"areaName4": "7e Arrondissement Paris",
"postCode1": "75007",
"postCode2": "",
"country": "FRA",
"addressNumber": "",
"streetName": "du Champ de Mars",
"unitType": null,
"unitValue": null,
"customFields": {
"REVERSE_GEOCODE_DISTANCE_UNIT": "METER",
"REVERSE_GEOCODE_DISTANCE": "23.3"
}
},
"ranges": []
}
]
}
]
}