Example: JSON GET Request & Response
The following is an example of a JSON GET request for the Geocode service. Note that the query parameters are separated by an ampersand.
GET http://myserver:8080/Geocode/rest/GeocodeService/geocode.json?
mainAddress=SANTA ANA&country=Mex&areaName1=DISTRITO FEDERAL
&postalCode=44910 HTTP/1.1
GET http://myserver:8080/rest/GlobalGeocode/geocode.json?
mainAddress=SANTA ANA&country=Mex&areaName1=DISTRITO FEDERAL
&postalCode=44910 HTTP/1.1
The following shows the JSON response returned by the previous request.
{
"totalPossibleCandidates": 3,
"totalMatches": 3,
"candidates": [
{
"precisionLevel": 3,
"formattedStreetAddress": "",
"formattedLocationAddress": "44910 GUADALAJARA, JALISCO",
"identifier": null,
"precisionCode": "Z1",
"sourceDictionary": "0",
"matching": null,
"geometry": {
"type": "Point",
"coordinates": [
-103.356,
20.64732
],
"crs": {
"type": "name",
"properties": {
"name": "epsg:4326"
}
}
},
"address": {
"mainAddressLine": "",
"addressLastLine": "44910 GUADALAJARA, JALISCO",
"placeName": "",
"areaName1": "JALISCO",
"areaName2": "GUADALAJARA",
"areaName3": "GUADALAJARA",
"areaName4": "8 DE JULIO 1RA SECC",
"postCode1": "44910",
"postCode2": "",
"country": "MEX",
"addressNumber": "",
"streetName": "",
"unitType": null,
"unitValue": null,
"customFields": {}
},
"ranges": []
}
]
}