GetPostalCodes - 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

GetPostalCodes allows you to look up the postal codes for a particular city. The service takes a city, state, and country as input and returns the postal codes for that city. The input must be exactly correct in order to return postal codes.

Note: GetPostalCodes only works with U.S. addresses.

GetPostalCodes is part of the Spectrum Universal Address.

Resource URL

JSON endpoint:

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

XML endpoint:

http://server:port/rest/GetPostalCodes/results.xml
https://OnDemandServer/rest/GetPostalCodes/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/GetPostalCodes/results.json?​Data.City=Holland&Data.StateProvince=MI
https://spectrum.precisely.com/rest/GetPostalCodes/results.json?​Data.City=Holland&Data.StateProvince=MI

The JSON returned by this request would be:

{"output_port": [
      {
      "ProcessedBy": "USA",
      "PostalCode": "49422",
      "Status": "",
      "City.Type": " ",
      "Status.Code": "",
      "Status.Description": "",
      "user_fields": []
   },
      {
      "ProcessedBy": "USA",
      "PostalCode": "49423",
      "Status": "",
      "City.Type": " ",
      "Status.Code": "",
      "Status.Description": "",
      "user_fields": []
   },
      {
      "ProcessedBy": "USA",
      "PostalCode": "49424",
      "Status": "",
      "City.Type": " ",
      "Status.Code": "",
      "Status.Description": "",
      "user_fields": []
   }
]}

Example with XML Response

The following example requests an XML response:

http://myserver:8080/rest/GetPostalCodes/results.xml?Data.City=Holland&​Data.StateProvince=MI
https://spectrum.precisely.com/rest/GetPostalCodes/results.xml?Data.City=Holland&​Data.StateProvince=MI

The XML returned by this request would be:

<ns2:xml.GetPostalCodesResponse
xmlns:ns2="http://www.pb.com/spectrum/services/GetPostalCodes">
   <ns2:output_port>
      <ns2:Result>
         <ns2:ProcessedBy>USA</ns2:ProcessedBy>
         <ns2:PostalCode>49422</ns2:PostalCode>
         <ns2:City.Type></ns2:City.Type>
         <ns2:Status/>
         <ns2:Status.Code/>
         <ns2:Status.Description/>
         <ns2:user_fields/>
      </ns2:Result>
      <ns2:Result>
         <ns2:ProcessedBy>USA</ns2:ProcessedBy>
         <ns2:PostalCode>49423</ns2:PostalCode>
         <ns2:City.Type></ns2:City.Type>
         <ns2:Status/>
         <ns2:Status.Code/>
         <ns2:Status.Description/>
         <ns2:user_fields/>
      </ns2:Result>
      <ns2:Result>
         <ns2:ProcessedBy>USA</ns2:ProcessedBy>
         <ns2:PostalCode>49424</ns2:PostalCode>
         <ns2:City.Type></ns2:City.Type>
         <ns2:Status/>
         <ns2:Status.Code/>
         <ns2:Status.Description/>
         <ns2:user_fields/>
      </ns2:Result>
   </ns2:output_port>
</ns2:xml.GetPostalCodesResponse>