Address Search Request
You can use the getdata.aspx to perform an Address Search. The getdata.aspx may be found in the web subfolder e.g. http://custom.astun.local/mycouncil/web/getdata.aspx?. There are two different Address Search Request types:
- AJAX Request
- JSONP Request
AJAX Request
Performing this AJAX request will return JSON formatted results.
Request
http://custom.astun.local/mycouncil/web/getdata.aspx?service=LocationSearch&RequestType=LocationSearch&location=rh5&pagesize=10&startnum=1
Parameters
Name | Requirement | Description |
---|---|---|
service | mandatory | This will always be “LocationSearch” |
RequestType | mandatory | This will always be “LocationSearch” |
location | mandatory | The address that you wish to search for or a UPRN. In the above example we wish to return all addresses that contain “RH5” |
pagesize | mandatory | This is the number of results that you wish to return |
startnum | mandatory | This would be 1 the first time that you made a call and then, if the maximum number of results requested were returned you would then make another call with the same information only specifying a startnum = pagesize +1 etc. |
mapsource | optional | This specifies the mapsource to use if you are using Shared Services e.g. &mapsource=WOxford/MyHouse |
gettotals | optional | The purpose of this parameter is to count the number of results and set the 'total' value in the response, which is otherwise 0. It's not on by default because the total is calculated by re-doing the query and therefore makes the response noticeably slower. |
Results
JSONP Request
Performing this JSONP request will return the results to your specified function.
Request
<script type="text/javascript" src="http://my.council.gov.uk/web/getdata.aspx?callback=FunctionName&type=jsonp&service=LocationSearch&RequestType=LocationSearch&location=42&pagesize=21&startnum=1"> </script>
Parameters
Name | Requirement | Description |
---|---|---|
callback | mandatory | This is the function name that you wish to use to format the results |
type | mandatory | This will always be “jsonp” |
service | mandatory | This will always be “LocationSearch” |
RequestType | mandatory | This will always be “LocationSearch” |
location | mandatory | The address that you wish to search for or a UPRN. In the above example we wish to return all addresses that contain “21” |
pagesize | mandatory | This is the number of results that you wish to return |
startnum | mandatory | This would be 1 the first time that you made a call and then, if the maximum number of results requested were returned you would then make another call with the same information only specifying a startnum = pagesize +1 etc. |
mapsource | optional | This specifies the mapsource to use if you are using Shared Services e.g. &mapsource=WOxford/MyHouse |
gettotals | optional | The purpose of this parameter is to count the number of results and set the 'total' value in the response, which is otherwise 0. It's not on by default because the total is calculated by re-doing the query and therefore makes the response noticeably slower. |