GetPostalCodes - Spectrum_OnDemand - addressing - web_services - Latest

Spectrum OnDemand Web Services (REST)

Product type
Software
Portfolio
Verify
Product family
Spectrum
Product
Spectrum > Discovery
Spectrum > Web Services
Spectrum > Spatial > Spectrum Spatial Insights
Spectrum > Dataflow Designer
Spectrum > Geo Addressing > Enterprise Tax
Spectrum > Spatial > Spectrum Spatial Analyst
Spectrum OnDemand
Spectrum > Quality > Context Graph
Spectrum > Spectrum Platform
Spectrum > Quality > Addressing
Spectrum > Spatial > Spectrum Spatial
Spectrum > Quality > Spectrum Quality
Version
Latest
Language
English
Product name
Spectrum OnDemand
Title
Spectrum OnDemand Web Services (REST)
Copyright
2024
First publish date
2006
Last updated
2024-08-28
Published on
2024-08-28T12:55:51.727818

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>