Difference between revisions of "XcelDataAPI:Version 0.2/standardize-address"

From XcelData Wiki
Jump to: navigation, search
(Created page with " == Example == Let's look up the work address currently located at: '''2118 F St, Bakersfield, CA 93301''' == XML Example == <pre> <Requests> <Request ID="1"> <Address...")
 
Line 1: Line 1:
  
 
== Example ==
 
== Example ==
Let's look up the work address currently located at: '''2118 F St, Bakersfield, CA 93301'''
+
This endpoint allows you to query multiple addresses at the same time.
  
== XML Example ==
+
Let's look up the work address currently located at: '''2118 F St, Bakersfield, CA 93301''' and the old address located at: '''5880 District Blvd Ste 5, Bakersfield, CA 93301'''
  
 +
== Request ==
 +
 +
The incoming request can be in either XML or JSON format and should be post data (or alternatively if using application/x-www-form-urlencoded use the key "data" and pass it the xml or json as a string).
 +
 +
{|
 +
|-
 +
! XML - <nowiki>/0.2/</nowiki>[[XcelData:Terms#output-format|xml]]/[[XcelData:Terms#api-key|api-key]]/standardize-address
 +
! JSON - <nowiki>/0.2/</nowiki>[[XcelData:Terms#output-format|json]]/[[XcelData:Terms#api-key|api-key]]/standardize-address
 +
|-
 +
|
 
<pre>
 
<pre>
<Requests>
+
&lt;Requests&gt;
   <Request ID="1">
+
   &lt;Request ID=&quot;1&quot;&gt;
     <Address1>2118 F St</Address1>
+
     &lt;Address1&gt;2118 F St&lt;/Address1&gt;
     <City>Bakersfield</City>
+
     &lt;City&gt;Bakersfield&lt;/City&gt;
     <State>CA</State>
+
     &lt;State&gt;CA&lt;/State&gt;
     <Zip5>93301</Zip5>
+
     &lt;Zip5&gt;93301&lt;/Zip5&gt;
   </Request>
+
   &lt;/Request&gt;
</Requests>
+
  &lt;Request ID=&quot;2&quot;&gt;
 +
    &lt;Address1&gt;5880 District Blvd Ste 5&lt;/Address1&gt;
 +
    &lt;City&gt;Bakersfield&lt;/City&gt;
 +
    &lt;State&gt;CA&lt;/State&gt;
 +
    &lt;Zip5&gt;93313&lt;/Zip5&gt;
 +
  &lt;/Request&gt;
 +
&lt;/Requests&gt;
 
</pre>
 
</pre>
 
+
|
== JSON Example ==
 
 
 
 
<pre>
 
<pre>
 
{"Requests": [
 
{"Requests": [
Line 26: Line 40:
 
     "State": "CA",
 
     "State": "CA",
 
     "Zip5": 93301
 
     "Zip5": 93301
 +
  },
 +
  {
 +
    "Address1": "5880 District Blvd Ste 5",
 +
    "City": "Bakersfield",
 +
    "ID": 1,
 +
    "State": "CA",
 +
    "Zip5": 93313
 
   }
 
   }
 
]}
 
]}
 
</pre>
 
</pre>
 +
 +
|}
 +
 +
== Output==
 +
 +
The output can either be XML or JSON. You specify that in the request url.
 +
 +
{|
 +
|-
 +
! XML - <nowiki>/0.2/</nowiki>[[XcelData:Terms#output-format|xml]]/[[XcelData:Terms#api-key|api-key]]/standardize-address
 +
! JSON - <nowiki>/0.2/</nowiki>[[XcelData:Terms#output-format|json]]/[[XcelData:Terms#api-key|api-key]]/standardize-address
 +
|-
 +
|
 +
<pre>
 +
&lt;?xml version=&quot;1.0&quot;?&gt;
 +
&lt;root&gt;
 +
  &lt;success&gt;1&lt;/success&gt;
 +
  &lt;Results&gt;
 +
    &lt;Result ID=&quot;1&quot;&gt;
 +
      &lt;ID&gt;1&lt;/ID&gt;
 +
      &lt;Address2&gt;2118 F ST&lt;/Address2&gt;
 +
      &lt;City&gt;BAKERSFIELD&lt;/City&gt;
 +
      &lt;State&gt;CA&lt;/State&gt;
 +
      &lt;Zip5&gt;93301&lt;/Zip5&gt;
 +
      &lt;Zip4&gt;3826&lt;/Zip4&gt;
 +
    &lt;/Result&gt;
 +
    &lt;Result ID=&quot;2&quot;&gt;
 +
      &lt;ID&gt;2&lt;/ID&gt;
 +
      &lt;Address1&gt;STE 5&lt;/Address1&gt;
 +
      &lt;Address2&gt;5880 DISTRICT BLVD&lt;/Address2&gt;
 +
      &lt;City&gt;BAKERSFIELD&lt;/City&gt;
 +
      &lt;State&gt;CA&lt;/State&gt;
 +
      &lt;Zip5&gt;93313&lt;/Zip5&gt;
 +
      &lt;Zip4&gt;2138&lt;/Zip4&gt;
 +
    &lt;/Result&gt;
 +
  &lt;/Results&gt;
 +
&lt;/root&gt;
 +
</pre>
 +
|
 +
<pre>
 +
{
 +
  "success": true,
 +
  "Results": [
 +
    {
 +
      "ID": "1",
 +
      "Address2": "2118 F ST",
 +
      "City": "BAKERSFIELD",
 +
      "State": "CA",
 +
      "Zip5": "93301",
 +
      "Zip4": "3826"
 +
    },
 +
    {
 +
      "ID": "2",
 +
      "Address1": "STE 5",
 +
      "Address2": "5880 DISTRICT BLVD",
 +
      "City": "BAKERSFIELD",
 +
      "State": "CA",
 +
      "Zip5": "93313",
 +
      "Zip4": "2138"
 +
    }
 +
  ]
 +
}
 +
</pre>
 +
|}

Revision as of 22:39, 30 April 2018

Example

This endpoint allows you to query multiple addresses at the same time.

Let's look up the work address currently located at: 2118 F St, Bakersfield, CA 93301 and the old address located at: 5880 District Blvd Ste 5, Bakersfield, CA 93301

Request

The incoming request can be in either XML or JSON format and should be post data (or alternatively if using application/x-www-form-urlencoded use the key "data" and pass it the xml or json as a string).

XML - /0.2/xml/api-key/standardize-address JSON - /0.2/json/api-key/standardize-address
<Requests>
  <Request ID="1">
    <Address1>2118 F St</Address1>
    <City>Bakersfield</City>
    <State>CA</State>
    <Zip5>93301</Zip5>
  </Request>
  <Request ID="2">
    <Address1>5880 District Blvd Ste 5</Address1>
    <City>Bakersfield</City>
    <State>CA</State>
    <Zip5>93313</Zip5>
  </Request>
</Requests>
{"Requests": [
  {
    "Address1": "2118 F St",
    "City": "Bakersfield",
    "ID": 1,
    "State": "CA",
    "Zip5": 93301
  },
  {
    "Address1": "5880 District Blvd Ste 5",
    "City": "Bakersfield",
    "ID": 1,
    "State": "CA",
    "Zip5": 93313
  }
]}

Output

The output can either be XML or JSON. You specify that in the request url.

XML - /0.2/xml/api-key/standardize-address JSON - /0.2/json/api-key/standardize-address
<?xml version="1.0"?>
<root>
  <success>1</success>
  <Results>
    <Result ID="1">
      <ID>1</ID>
      <Address2>2118 F ST</Address2>
      <City>BAKERSFIELD</City>
      <State>CA</State>
      <Zip5>93301</Zip5>
      <Zip4>3826</Zip4>
    </Result>
    <Result ID="2">
      <ID>2</ID>
      <Address1>STE 5</Address1>
      <Address2>5880 DISTRICT BLVD</Address2>
      <City>BAKERSFIELD</City>
      <State>CA</State>
      <Zip5>93313</Zip5>
      <Zip4>2138</Zip4>
    </Result>
  </Results>
</root>
{
  "success": true,
  "Results": [
    {
      "ID": "1",
      "Address2": "2118 F ST",
      "City": "BAKERSFIELD",
      "State": "CA",
      "Zip5": "93301",
      "Zip4": "3826"
    },
    {
      "ID": "2",
      "Address1": "STE 5",
      "Address2": "5880 DISTRICT BLVD",
      "City": "BAKERSFIELD",
      "State": "CA",
      "Zip5": "93313",
      "Zip4": "2138"
    }
  ]
}