POST api/Lookup/GetCityFromZip
Gets a city from zip code
Examples
Get city from zip using a jQuery Ajax call
//Setup the CityArgumentModel
var arg = {
TicketId :'7ECEB7B7-B533-492D-8321-E92D198551AF',
TransactionKey : "383763838393",
Zip: "4621",
Country: "no"
};
function getCityFromZip () {
$.ajax({
url: 'https://api.infocare.com/api/Lookup/GetCityFromZip',
type: "POST",
data: JSON.stringify(arg),
contentType: "application/json;charset=utf-8"
})
.done(function (result) {
var city = result.City
})
.fail(function (jqXHR, textStatus, err) {
console.log("logon failed: " + err);
})
});
Request Information
URI Parameters
None.
Body Parameters
Specify zip
CityArgumentModel| Name | Description | Type | Additional information |
|---|---|---|---|
| Zip |
Get or set Zip |
string |
None. |
| Country |
Gets or sets country |
string |
None. |
| TicketId |
Gets or sets the ticket id |
string |
None. |
| Culture |
Gets or sets culture, if not specified we will use culture set on user. |
string |
None. |
Request Formats
application/json, text/json
Sample:
{
"Zip": "sample string 1",
"Country": "sample string 2",
"TicketId": "sample string 3",
"Culture": "sample string 4"
}
application/xml, text/xml
Sample:
<CityArgumentModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">
<Culture>sample string 4</Culture>
<TicketId>sample string 3</TicketId>
<Country>sample string 2</Country>
<Zip>sample string 1</Zip>
</CityArgumentModel>
application/x-www-form-urlencoded
Sample:
Response Information
Resource Description
A city if found, null otherwise
CityReturnModel| Name | Description | Type | Additional information |
|---|---|---|---|
| City |
Gets or sets city |
string |
None. |
| CombinedPerformanceId |
Gets or sets the performance id. If performance monitoring is not turned on this property will not be present or set to null |
string |
Json null value handling: Ignore |
Response Formats
application/json, text/json
Sample:
{
"City": "sample string 1",
"CombinedPerformanceId": "sample string 2"
}
application/xml, text/xml
Sample:
<CityReturnModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Rostov.Models">
<CombinedPerformanceId>sample string 2</CombinedPerformanceId>
<City>sample string 1</City>
</CityReturnModel>