GetCityStateProvince - Spectrum_OnDemand - addressing - web_services - Latest

Spectrum OnDemand Web Services (REST)

Product type
Software
Portfolio
Verify
Product family
Spectrum
Product
Spectrum > Geocoding > Enterprise Tax
Spectrum > Web Services
Spectrum > Spatial > Spectrum Spatial
Spectrum > Spectrum Platform
Spectrum > Quality > Addressing
Spectrum > Quality > Spectrum Quality
Spectrum > Spatial > Spectrum Spatial Insights
Spectrum > Discovery
Spectrum OnDemand
Spectrum > Dataflow Designer
Spectrum > Spatial > Spectrum Spatial Analyst
Spectrum > Quality > Context Graph
Version
Latest
Language
English
Product name
Spectrum OnDemand
Title
Spectrum OnDemand Web Services (REST)
Copyright
2024
First publish date
2006
ft:lastEdition
2024-07-17
ft:lastPublication
2024-07-17T23:23:16.481321

GetCityStateProvince returns a city and state/province for a given input postal code.

Note: GetCityStateProvince works with U.S. and Canadian addresses only.

GetCityStateProvince is part of Spectrum Universal Address.

Resource URL

JSON endpoint:

http://server:port/rest/GetCityStateProvince/results.json
https://OnDemandServer/rest/GetCityStateProvince/results.json

XML endpoint:

http://server:port/rest/GetCityStateProvince/results.xml
https://OnDemandServer/rest/GetCityStateProvince/results.xml

For a list of Spectrum OnDemand servers, see Connecting to Spectrum OnDemand Servers.

Example with JSON Response

The following example requests a JSON response:

http://myserver:8080/rest/GetCityStateProvince/results.json?​Data.PostalCode=12180
https://spectrum.precisely.com/rest/GetCityStateProvince/results.json?​Data.PostalCode=12180

The JSON returned by this request would be:

{"output_port": [{
   "ProcessedBy": "USA",
   "PostalCode": "12180",
   "City": "TROY",
   "StateProvince": "NY",
   "Country": "USA",
   "City.Type": "P",
   "user_fields": []
}]}

Example with XML Response

The following example requests an XML response:

http://myserver:8080/rest/GetCityStateProvince/results.xml?​Data.PostalCode=12180
https://spectrum.precisely.com/rest/GetCityStateProvince/results.xml?​Data.PostalCode=12180

The XML returned by this request would be:

<ns2:xml.GetCityStateProvinceResponse
xmlns:ns2="http://www.pb.com/spectrum/services/GetCityStateProvince">
   <ns2:output_port>
      <ns2:Result>
         <ns2:ProcessedBy>USA</ns2:ProcessedBy>
         <ns2:PostalCode>12180</ns2:PostalCode>
         <ns2:City>TROY</ns2:City>
         <ns2:City.Type>P</ns2:City.Type>
         <ns2:StateProvince>NY</ns2:StateProvince>
         <ns2:Country>USA</ns2:Country>
         <ns2:user_fields/>
      </ns2:Result>
   </ns2:output_port>
</ns2:xml.GetCityStateProvinceResponse>