{"id":10831,"date":"2025-05-21T14:59:49","date_gmt":"2025-05-21T21:59:16","guid":{"rendered":"https:\/\/www.serviceobjects.com\/docs\/?page_id=10831"},"modified":"2025-10-10T02:43:36","modified_gmt":"2025-10-10T09:43:36","slug":"av3-rest","status":"publish","type":"page","link":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/","title":{"rendered":"AV3 \u2013 REST\u00a0"},"content":{"rendered":"\n<div class=\"wp-block-create-block-tabs\"><ul class=\"tab-labels\" role=\"tablist\" aria-label=\"tabbed content\"><li class=\"tab-label active\" role=\"tab\" aria-selected=\"true\" aria-controls=\"C#\" tabindex=\"0\">C#<\/li><li class=\"tab-label\" role=\"tab\" aria-selected=\"false\" aria-controls=\"Python\" tabindex=\"0\">Python<\/li><li class=\"tab-label\" role=\"tab\" aria-selected=\"false\" aria-controls=\"NodeJS\" tabindex=\"0\">NodeJS<\/li><\/ul><div class=\"tab-content\">\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong>Address Validation 3 C# Rest Code Snippet<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\ufeffusing System.Threading.Tasks;\n\nnamespace address_validation_us_3_dot_net.REST\n{\n    \/\/\/ &lt;summary>\n    \/\/\/ Client for the AV3 GetBestMatches operation, providing both sync and async methods.\n    \/\/\/ Handles live vs. trial endpoints, URL encoding, fallback logic, and JSON deserialization.\n    \/\/\/ &lt;\/summary>\n    public static class GetBestMatchesClient\n    {\n        \/\/ Base URL constants: production, backup, and trial\n        private const string LiveBaseUrl = \"https:\/\/sws.serviceobjects.com\/AV3\/api.svc\/\";\n        private const string BackupBaseUrl = \"https:\/\/swsbackup.serviceobjects.com\/AV3\/api.svc\/\";\n        private const string TrialBaseUrl = \"https:\/\/trial.serviceobjects.com\/AV3\/api.svc\/\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Synchronously invoke the GetBestMatchesJson endpoint.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"input\">Data for the request (address components, license key, isLive).&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"GBMResponse\"\/>.&lt;\/returns>\n        public static GBMResponse Invoke(GetBestMatchesInput input)\n        {\n            \/\/Use query string parameters so missing\/options fields don't break\n            \/\/the URL as path parameters would.\n            var url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            GBMResponse response = Helper.HttpGet&lt;GBMResponse>(url, input.TimeoutSeconds);\n\n            \/\/ Fallback on error payload in live mode\n            if (input.IsLive &amp;&amp; !IsValid(response))\n            {\n                var fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                GBMResponse fallbackResponse = Helper.HttpGet&lt;GBMResponse>(fallbackUrl, input.TimeoutSeconds);\n                return fallbackResponse;\n            }\n\n            return response;\n        }\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Asynchronously invoke the GetBestMatchesJson endpoint.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"input\">Data for the request (address components, license key, isLive).&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"GBMResponse\"\/>.&lt;\/returns>\n        public static async Task&lt;GBMResponse> InvokeAsync(GetBestMatchesInput input)\n        {\n            \/\/Use query string parameters so missing\/options fields don't break\n            \/\/the URL as path parameters would.\n            var url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            GBMResponse response = await Helper.HttpGetAsync&lt;GBMResponse>(url, input.TimeoutSeconds).ConfigureAwait(false);\n\n            if (input.IsLive &amp;&amp; !IsValid(response))\n            {\n                var fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                GBMResponse fallbackResponse = await Helper.HttpGetAsync&lt;GBMResponse>(fallbackUrl, input.TimeoutSeconds).ConfigureAwait(false);\n                return fallbackResponse;\n            }\n\n            return response;\n        }\n\n        \/\/ Build the full request URL, including URL-encoded query string\n        private static string BuildUrl(GetBestMatchesInput input, string baseUrl)\n        {\n            var qs = $\"GetBestMatchesJson?BusinessName={Helper.UrlEncode(input.BusinessName)}\" +\n                     $\"&amp;Address={Helper.UrlEncode(input.Address)}\" +\n                     $\"&amp;Address2={Helper.UrlEncode(input.Address2)}\" +\n                     $\"&amp;City={Helper.UrlEncode(input.City)}\" +\n                     $\"&amp;State={Helper.UrlEncode(input.State)}\" +\n                     $\"&amp;PostalCode={Helper.UrlEncode(input.PostalCode)}\" +\n                     $\"&amp;LicenseKey={Helper.UrlEncode(input.LicenseKey)}\";\n            return baseUrl + qs;\n        }\n\n        private static bool IsValid(GBMResponse response) => response?.Error == null || response.Error.TypeCode != \"3\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Input parameters for the GetBestMatchesSingleLine operation.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"BusinessName\">Company name to assist suite parsing (e.g., \"Acme Corp\"). - Optional&lt;\/param>\n        \/\/\/ &lt;param name=\"Address\">Address line 1 (e.g., \"123 Main St\") - Required.&lt;\/param>\n        \/\/\/ &lt;param name=\"Address2\">Address line 2 - Optional&lt;\/param>\n        \/\/\/ &lt;param name=\"City\">City - Required when PostalCode is missing.&lt;\/param>\n        \/\/\/ &lt;param name=\"State\">State - Required when PostalCode is missing.&lt;\/param>\n        \/\/\/ &lt;param name=\"PostalCode\">PostalCode - Required when City and state are missing.&lt;\/param>\n        \/\/\/ &lt;param name=\"LicenseKey\">Service Objects AV3 license key. - Required&lt;\/param>\n        \/\/\/ &lt;param name=\"IsLive\">True for live (production+backup) endpoints; false for trial only. - Required&lt;\/param>\n        \/\/\/ &lt;param name=\"TimeoutSeconds\">Request timeout in seconds (default: 15).&lt;\/param>\n        public record GetBestMatchesInput(\n                                            string BusinessName = \"\",\n                                            string Address = \"\",\n                                            string Address2 = \"\",\n                                            string City = \"\",\n                                            string State = \"\",\n                                            string PostalCode = \"\",\n                                            string LicenseKey = \"\",\n                                            bool IsLive = true,\n                                            int TimeoutSeconds = 15\n        );\n    }\n}\n\n\n\ufeffusing System.Runtime.Serialization;\n\nnamespace address_validation_us_3_dot_net.REST\n{\n    \/\/\/ &lt;summary>\n    \/\/\/ Response object for capturing the reponse from the API for GetBestMatches\n    \/\/\/ &lt;\/summary>\n    [DataContract]\n    public class GBMResponse\n    {\n        [DataMember(Name = \"Addresses\")]\n        public Address[] Addresses { get; set; }\n        [DataMember(Name = \"IsCASS\")]\n        public bool IsCASS { get; set; }\n        [DataMember(Name = \"Error\")]\n        public Error Error { get; set; }\n        public override string ToString()\n        {\n            string Output = \"\";\n            Output += $\"GBM Response:\\n\";\n            Output += $\"List of all Addresses: [\";\n            if (Addresses != null &amp;&amp; Addresses.Length > 0)\n            {\n                foreach (Address A in Addresses)\n                {\n                    Output += A.ToString() + \"\\n\";\n                }\n            }\n            Output += \"]\\n\";\n            Output += $\"IsCASS: {IsCASS}\\n\";\n            Output += $\"Error: {{{Error}}}\\n\";\n            return Output;\n        }\n\n    }\n\n    \/\/\/ &lt;summary>\n    \/\/\/ Response object for capturing the reponse from the API for GetSecondaryNumbers\n    \/\/\/ &lt;\/summary>\n    public class GSNResponse\n    {\n        [DataMember(Name = \"Address1\")]\n        public string Address1 { get; set; }\n        [DataMember(Name = \"City\")]\n        public string City { get; set; }\n        [DataMember(Name = \"State\")]\n        public string State { get; set; }\n        [DataMember(Name = \"Zip\")]\n        public string Zip { get; set; }\n        [DataMember(Name = \"TotalCount\")]\n        public int TotalCount { get; set; }\n        [DataMember(Name = \"SecondaryNumbers\")]\n        public string[] SecondaryNumbers { get; set; }\n\n        [DataMember(Name = \"Error\")]\n        public Error Error { get; set; }\n\n        public override string ToString()\n        {\n            string Output = \"\";\n            Output += $\"GSN Response:\\n\";\n            Output += $\"Address1: {Address1}\\n\";\n            Output += $\"City: {City}\\n\";\n            Output += $\"State: {State}\\n\";\n            Output += $\"Zip: {Zip}\\n\";\n            Output += $\"Total Count: {TotalCount}\\n\";\n            Output += $\"SecondaryNumbers: [\";\n            if (SecondaryNumbers != null &amp;&amp; SecondaryNumbers.Length > 0)\n            {\n                foreach (string A in SecondaryNumbers)\n\n                {\n                    Output += A.ToString() + \"\\n\";\n                }\n            }\n            Output += \"]\\n\";\n            Output += $\"Error: {Error}\\n\";\n            return Output;\n        }\n    }\n\n\n    \/\/\/ &lt;summary>\n    \/\/\/ Response object for capturing the reponse from the API for CityStateZip\n    \/\/\/ &lt;\/summary>\n    public class CSZResponse\n    {\n        [DataMember(Name = \"CityStateZip\")]\n        public CityStateZip CityStateZip { get; set; }\n\n        [DataMember(Name = \"Error\")]\n        public Error Error { get; set; }\n        public override string ToString()\n        {\n            return $\"CSZ Response:\\n\" +\n                $\"CityStateZip: {{{CityStateZip}}}\\n\" +\n                $\"Error: {{{Error}}}\\n\";\n        }\n    }\n\n    \/\/\/ &lt;summary>\n    \/\/\/ Object to house the addresses being returned.\n    \/\/\/ &lt;\/summary>\n    public class Address\n    {\n        [DataMember(Name = \"Address1\")]\n        public string Address1 { get; set; }\n        [DataMember(Name = \"Address2\")]\n        public string Address2 { get; set; }\n        [DataMember(Name = \"City\")]\n        public string City { get; set; }\n        [DataMember(Name = \"State\")]\n        public string State { get; set; }\n        [DataMember(Name = \"Zip\")]\n        public string Zip { get; set; }\n        [DataMember(Name = \"IsResidential\")]\n        public string IsResidential { get; set; }\n        [DataMember(Name = \"DPV\")]\n        public string DPV { get; set; }\n        [DataMember(Name = \"DPVDesc\")]\n        public string DPVDesc { get; set; }\n        [DataMember(Name = \"DPVNotes\")]\n        public string DPVNotes { get; set; }\n        [DataMember(Name = \"DPVNotesDesc\")]\n        public string DPVNotesDesc { get; set; }\n        [DataMember(Name = \"Corrections\")]\n        public string Corrections { get; set; }\n        [DataMember(Name = \"CorrectionsDesc\")]\n        public string CorrectionsDesc { get; set; }\n        [DataMember(Name = \"BarcodeDigits\")]\n        public string BarcodeDigits { get; set; }\n        [DataMember(Name = \"CarrierRoute\")]\n        public string CarrierRoute { get; set; }\n        [DataMember(Name = \"CongressCode\")]\n        public string CongressCode { get; set; }\n        [DataMember(Name = \"CountyCode\")]\n        public string CountyCode { get; set; }\n        [DataMember(Name = \"CountyName\")]\n        public string CountyName { get; set; }\n        [DataMember(Name = \"FragmentHouse\")]\n        public string FragmentHouse { get; set; }\n        [DataMember(Name = \"FragmentPreDir\")]\n        public string FragmentPreDir { get; set; }\n        [DataMember(Name = \"FragmentStreet\")]\n        public string FragmentStreet { get; set; }\n        [DataMember(Name = \"FragmentSuffix\")]\n        public string FragmentSuffix { get; set; }\n        [DataMember(Name = \"FragmentPostDir\")]\n        public string FragmentPostDir { get; set; }\n        [DataMember(Name = \"FragmentUnit\")]\n        public string FragmentUnit { get; set; }\n        [DataMember(Name = \"Fragment\")]\n        public string Fragment { get; set; }\n        [DataMember(Name = \"FragmentPMBPrefix\")]\n        public string FragmentPMBPrefix { get; set; }\n        [DataMember(Name = \"FragmentPMBNumber\")]\n        public string FragmentPMBNumber { get; set; }\n        public override string ToString()\n        {\n            return $\"\\n{{Address1: {Address1}\\n\" +\n                $\"\\tAddress2: {Address2}\\n\" +\n                $\"\\tCity: {City}\\n\" +\n                $\"\\tState: {State}\\n\" +\n                $\"\\tZip: {Zip}\\n\" +\n                $\"\\tIsResidential: {IsResidential}\\n\" +\n                $\"\\tDPV: {DPV}\\n\" +\n                $\"\\tDPVDesc: {DPVDesc}\\n\" +\n                $\"\\tDPVNotes: {DPVNotes}\\n\" +\n                $\"\\tDPVNotesDesc: {DPVNotesDesc}\\n\" +\n                $\"\\tCorrections: {Corrections}\\n\" +\n                $\"\\tCorrectionsDesc: {CorrectionsDesc}\\n\" +\n                $\"\\tBarcodeDigits: {BarcodeDigits}\\n\" +\n                $\"\\tCarrierRoute: {CarrierRoute}\\n\" +\n                $\"\\tCongressCode: {CongressCode}\\n\" +\n                $\"\\tCountyCode: {CountyCode}\\n\" +\n                $\"\\tCountyName: {CountyName}\\n\" +\n                $\"\\tFragmentHouse: {FragmentHouse}\\n\" +\n                $\"\\tFragmentPreDir: {FragmentPreDir}\\n\" +\n                $\"\\tFragmentStreet: {FragmentStreet}\\n\" +\n                $\"\\tFragmentSuffix: {FragmentSuffix}\\n\" +\n                $\"\\tFragmentPostDir: {FragmentPostDir}\\n\" +\n                $\"\\tFragmentUnit: {FragmentUnit}\\n\" +\n                $\"\\tFragment: {Fragment}\\n\" +\n                $\"\\tFragmentPMBPrefix: {FragmentPMBPrefix}\\n\" +\n                $\"\\tFragmentPMBNumber: {FragmentPMBNumber}}}\\n\";\n        }\n    }\n\n    public class CityStateZip\n    {\n        [DataMember(Name = \"City\")]\n        public string City { get; set; }\n        [DataMember(Name = \"State\")]\n        public string State { get; set; }\n        [DataMember(Name = \"Zip\")]\n        public string Zip { get; set; }\n        [DataMember(Name = \"GeneralDeliveryService\")]\n        public string GeneralDeliveryService { get; set; }\n        [DataMember(Name = \"POBoxService\")]\n        public string POBoxService { get; set; }\n        [DataMember(Name = \"StreetService\")]\n        public string StreetService { get; set; }\n        [DataMember(Name = \"RRHCService\")]\n        public string RRHCService { get; set; }\n        [DataMember(Name = \"UrbanizationService\")]\n        public string UrbanizationService { get; set; }\n        [DataMember(Name = \"POBoxRangeLow\")]\n        public string POBoxRangeLow { get; set; }\n        [DataMember(Name = \"POBoxRangeHigh\")]\n        public string POBoxRangeHigh { get; set; }\n        [DataMember(Name = \"IsUniqueZipCode\")]\n        public string IsUniqueZipCode { get; set; }\n        public override string ToString()\n        {\n            return $\"City: {City} \" +\n                $\"State: {State} \" +\n                $\"Zip: {Zip} \" +\n                $\"GeneralDeliveryService: {GeneralDeliveryService} \" +\n                $\"POBoxService: {POBoxService} \" +\n                $\"StreetService: {StreetService} \" +\n                $\"RRHCService: {RRHCService} \" +\n                $\"UrbanizationService: {UrbanizationService} \" +\n                $\"POBoxRangeLow: {POBoxRangeLow} \" +\n                $\"POBoxRangeHigh: {POBoxRangeHigh} \" +\n                $\"IsUniqueZipCode: {IsUniqueZipCode} \";\n        }\n    }\n\n    public class Error\n    {\n        [DataMember(Name = \"Type\")]\n        public string Type { get; set; }\n        [DataMember(Name = \"TypeCode\")]\n        public string TypeCode { get; set; }\n        [DataMember(Name = \"Desc\")]\n        public string Desc { get; set; }\n        [DataMember(Name = \"DescCode\")]\n        public string DescCode { get; set; }\n        public override string ToString()\n        {\n            return $\"Type: {Type} \" +\n                $\"TypeCode: {TypeCode} \" +\n                $\"Desc: {Desc} \" +\n                $\"DescCode: {DescCode} \";\n        }\n    }\n}\n\n\n\ufeffusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Net.Http;\nusing System.Reflection;\nusing System.Text;\nusing System.Text.Json;\nusing System.Threading.Tasks;\nusing System.Web;\n\nnamespace address_validation_us_3_dot_net.REST\n{\n    public class Helper\n    {\n        public static T HttpGet&lt;T>(string url, int timeoutSeconds)\n        {\n            using var httpClient = new HttpClient\n            {\n                Timeout = TimeSpan.FromSeconds(timeoutSeconds)\n            };\n            using var request = new HttpRequestMessage(HttpMethod.Get, url);\n            using HttpResponseMessage response = httpClient\n                .SendAsync(request)\n                .GetAwaiter()\n                .GetResult();\n            response.EnsureSuccessStatusCode();\n            using Stream responseStream = response.Content\n                .ReadAsStreamAsync()\n                .GetAwaiter()\n                .GetResult();\n            var options = new JsonSerializerOptions\n            {\n                PropertyNameCaseInsensitive = true\n            };\n            object? obj = JsonSerializer.Deserialize(responseStream, typeof(T), options);\n            T result = (T)obj!;\n            return result;\n        }\n\n        \/\/ Asynchronous HTTP GET and JSON deserialize\n        public static async Task&lt;T> HttpGetAsync&lt;T>(string url, int timeoutSeconds)\n        {\n            HttpClient HttpClient = new HttpClient();\n            HttpClient.Timeout = TimeSpan.FromSeconds(timeoutSeconds);\n            using var httpResponse = await HttpClient.GetAsync(url).ConfigureAwait(false);\n            httpResponse.EnsureSuccessStatusCode();\n            var stream = await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);\n            return JsonSerializer.Deserialize&lt;T>(stream)!;\n        }\n\n        public static string UrlEncode(string value) => HttpUtility.UrlEncode(value ?? string.Empty);\n    }\n}<\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong>Address Validation US 3 Python Code Snippet<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">'''\nService Objects, Inc.\n\nThis module provides the get_best_matches function to validate and standardize US addresses\nusing Service Objects AV3 API. It handles live\/trial endpoints, fallback logic, and JSON parsing.\n\nFunctions:\n    get_best_matches(business_name: str,\n                     address: str,\n                     address_2: str,\n                     city: str,\n                     state: str,\n                     postal_code: str,\n                     license_key: str,\n                     is_live: bool) -> dict:\n'''  \n\nimport requests  # HTTP client for RESTful API calls\n\n# Endpoint URLs for AV3 service\nprimary_url = 'https:\/\/sws.serviceobjects.com\/AV3\/api.svc\/GetBestMatchesJson?'\nbackup_url = 'https:\/\/swsbackup.serviceobjects.com\/AV3\/api.svc\/GetBestMatchesJson?'\ntrial_url = 'https:\/\/trial.serviceobjects.com\/AV3\/api.svc\/GetBestMatchesJson?'\n\ndef get_best_matches(business_name: str,\n                   address: str,\n                   address_2: str,\n                   city: str,\n                   state: str,\n                   postal_code: str,\n                   license_key: str,\n                   is_live: bool) -> dict:\n    \"\"\"\n    Call AV3 get_best_matches API and return validation results.\n\n    Parameters:\n        business_name (str): Company name to assist suite parsing.\n        address (str): Primary street address (e.g., '123 Main St'). Required.\n        address_2 (str): Secondary address info (e.g., 'C\/O John Smith').\n        city (str): City name; required if PostalCode not provided.\n        state (str): State code or full name; required if PostalCode not provided.\n        postal_code (str): 5- or 9-digit ZIP; required if City\/State not provided.\n        license_key (str): Service Objects license key.\n        is_live (bool): True for production endpoints, False for trial URL.\n\n    Returns:\n        dict: Parsed JSON response with address addresss or error details.\n\n    Raises:\n        RuntimeError: If the API returns an error payload.\n        requests.RequestException: On network\/HTTP failures (trial mode).\n    \"\"\"\n\n    # Prepare query parameters for AV3 API\n    params = {\n        'BusinessName': business_name,\n        'Address'     : address,\n        'Address2'    : address_2,\n        'City'        : city,\n        'State'       : state,\n        'PostalCode'  : postal_code,\n        'LicenseKey'  : license_key\n    }\n\n    # Select the base URL: production vs trial\n    url = primary_url if is_live else trial_url\n\n    # Attempt primary (or trial) endpoint first\n    try:\n        response = requests.get(url, params=params, timeout=10)\n        response.raise_for_status()\n        data = response.json()\n\n        # If API returned an error in JSON payload, trigger fallback\n        error = getattr(response, 'Error', None)\n        if not (error is None or getattr(error, 'TypeCode', None) != \"3\"):\n            if is_live:\n                # Try backup URL when live\n                response = requests.get(backup_url, params=params, timeout=10)\n                data = response.json()\n\n                # If still error, propagate exception\n                if 'Error' in data:\n                    raise RuntimeError(f\"AV3 service error: {data['Error']}\")\n            else:\n                # Trial mode should not fallback; error is terminal\n                raise RuntimeError(f\"AV3 trial error: {data['Error']}\")\n\n        # Success: return parsed JSON data\n        return data\n\n    except requests.RequestException as req_exc:\n        # Network or HTTP-level error occurred\n        if is_live:\n            try:\n                # Fallback to backup URL on network failure\n                response = requests.get(backup_url, params=params, timeout=10)\n                response.raise_for_status()\n                data = response.json()\n                if 'Error' in data:\n                    raise RuntimeError(f\"AV3 backup error: {data['Error']}\") from req_exc\n                return data\n            except Exception as backup_exc:\n                # Both primary and backup failed; escalate\n                raise RuntimeError(\"AV3 service unreachable on both endpoints\") from backup_exc\n        else:\n            # In trial mode, propagate the network exception\n            raise RuntimeError(f\"AV3 trial error: {str(req_exc)}\") from req_exc<\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong>Address Validation 3 NodeJS REST Code Snippet<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import axios from 'axios';\nimport querystring from 'querystring';\nimport { GetBestMatchesResponse } from '.\/av3_response.js';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the live ServiceObjects Address Validation (AV3) API service.\n *\/\nconst LiveBaseUrl = 'https:\/\/sws.serviceobjects.com\/av3\/api.svc\/json\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the backup ServiceObjects Address Validation (AV3) API service.\n *\/\nconst BackupBaseUrl = 'https:\/\/swsbackup.serviceobjects.com\/av3\/api.svc\/json\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the trial ServiceObjects Address Validation (AV3) API service.\n *\/\nconst TrialBaseUrl = 'https:\/\/trial.serviceobjects.com\/av3\/api.svc\/json\/';\n\n\/**\n * &lt;summary>\n * Checks if a response from the API is valid by verifying that it either has no Error object\n * or the Error.TypeCode is not equal to '3'.\n * &lt;\/summary>\n * &lt;param name=\"response\" type=\"Object\">The API response object to validate.&lt;\/param>\n * &lt;returns type=\"boolean\">True if the response is valid, false otherwise.&lt;\/returns>\n *\/\nconst isValid = (response) => !response?.Error || response.Error.TypeCode !== '3';\n\n\/**\n * &lt;summary>\n * Constructs a full URL for the GetBestMatches API endpoint by combining the base URL\n * with query parameters derived from the input parameters.\n * &lt;\/summary>\n * &lt;param name=\"params\" type=\"Object\">An object containing all the input parameters.&lt;\/param>\n * &lt;param name=\"baseUrl\" type=\"string\">The base URL for the API service (live, backup, or trial).&lt;\/param>\n * &lt;returns type=\"string\">The constructed URL with query parameters.&lt;\/returns>\n *\/\nconst buildUrl = (params, baseUrl) =>\n    `${baseUrl}GetBestMatchesJson?${querystring.stringify(params)}`;\n\n\/**\n * &lt;summary>\n * Performs an HTTP GET request to the specified URL with a given timeout.\n * &lt;\/summary>\n * &lt;param name=\"url\" type=\"string\">The URL to send the GET request to.&lt;\/param>\n * &lt;param name=\"timeoutSeconds\" type=\"number\">The timeout duration in seconds for the request.&lt;\/param>\n * &lt;returns type=\"Promise&lt;GetBestMatchesResponse>\">A promise that resolves to a GetBestMatchesResponse object containing the API response data.&lt;\/returns>\n * &lt;exception cref=\"Error\">Thrown if the HTTP request fails, with a message detailing the error.&lt;\/exception>\n *\/\nconst httpGet = async (url, timeoutSeconds) => {\n    try {\n        const response = await axios.get(url, { timeout: timeoutSeconds * 1000 });\n        return new GetBestMatchesResponse(response.data);\n    } catch (error) {\n        throw new Error(`HTTP request failed: ${error.message}`);\n    }\n};\n\n\/**\n * &lt;summary>\n * Provides functionality to call the ServiceObjects Address Validation (AV3) API's GetBestMatches endpoint,\n * retrieving validated and corrected address information for a given U.S. address with fallback to a backup endpoint for reliability in live mode.\n * &lt;\/summary>\n *\/\nconst GetBestMatchesClient = {\n    \/**\n     * &lt;summary>\n     * Asynchronously invokes the GetBestMatches API endpoint, attempting the primary endpoint\n     * first and falling back to the backup if the response is invalid (Error.TypeCode == '3') in live mode.\n     * &lt;\/summary>\n     * @param {string} BusinessName - Name of business associated with this address. Optional.\n     * @param {string} Address - Address line of the address to validate (e.g., \"123 Main Street\"). Required.\n     * @param {string} Address2 - Additional address information (e.g., \"C\/O John Smith\"). Optional.\n     * @param {string} City - The city of the address to validate (e.g., \"New York\"). Optional, but required if PostalCode is not provided.\n     * @param {string} State - The state of the address to validate (e.g., \"NY\"). Optional, but required if PostalCode is not provided.\n     * @param {string} PostalCode - The zip code of the address to validate. Optional, but required if City and State are not provided.\n     * @param {string} LicenseKey - Your license key to use the service. Required.\n     * @param {boolean} isLive - Value to determine whether to use the live or trial servers. Defaults to true.\n     * @param {number} timeoutSeconds - Timeout, in seconds, for the call to the service. Defaults to 15.\n     * @returns {Promise&lt;GetBestMatchesResponse>} - A promise that resolves to a GetBestMatchesResponse object.\n     *\/\n    async invokeAsync(BusinessName, Address, Address2, City, State, PostalCode, LicenseKey, isLive = true, timeoutSeconds = 15) {\n        const params = {\n            BusinessName,\n            Address,\n            Address2,\n            City,\n            State,\n            PostalCode,\n            LicenseKey\n        };\n\n        \/\/ Remove null\/undefined params to avoid empty query params\n        Object.keys(params).forEach(key => params[key] == null &amp;&amp; delete params[key]);\n\n        const url = buildUrl(params, isLive ? LiveBaseUrl : TrialBaseUrl);\n        let response = await httpGet(url, timeoutSeconds);\n\n        if (isLive &amp;&amp; !isValid(response)) {\n            const fallbackUrl = buildUrl(params, BackupBaseUrl);\n            const fallbackResponse = await httpGet(fallbackUrl, timeoutSeconds);\n            return fallbackResponse;\n        }\n        return response;\n    },\n\n    \/**\n     * &lt;summary>\n     * Synchronously invokes the GetBestMatches API endpoint by wrapping the async call\n     * and awaiting its result immediately.\n     * &lt;\/summary>\n     * @param {string} BusinessName - Name of business associated with this address. Optional.\n     * @param {string} Address - Address line of the address to validate (e.g., \"123 Main Street\"). Required.\n     * @param {string} Address2 - Additional address information (e.g., \"C\/O John Smith\"). Optional.\n     * @param {string} City - The city of the address to validate (e.g., \"New York\"). Optional, but required if PostalCode is not provided.\n     * @param {string} State - The state of the address to validate (e.g., \"NY\"). Optional, but required if PostalCode is not provided.\n     * @param {string} PostalCode - The zip code of the address to validate. Optional, but required if City and State are not provided.\n     * @param {string} LicenseKey - Your license key to use the service. Required.\n     * @param {boolean} isLive - Value to determine whether to use the live or trial servers. Defaults to true.\n     * @param {number} timeoutSeconds - Timeout, in seconds, for the call to the service. Defaults to 15.\n     * @returns {GetBestMatchesResponse} - A GetBestMatchesResponse object with validated address details or an error.\n     *\/\n    invoke(BusinessName, Address, Address2, City, State, PostalCode, LicenseKey, isLive = true, timeoutSeconds = 15) {\n        return (async () => await this.invokeAsync(\n            BusinessName, Address, Address2, City, State, PostalCode, LicenseKey, isLive, timeoutSeconds\n        ))();\n    }\n};\n\nexport { GetBestMatchesClient, GetBestMatchesResponse };\n\n\nexport class Address {\n    constructor(data = {}) {\n        this.Address1 = data.Address1;\n        this.Address2 = data.Address2;\n        this.City = data.City;\n        this.State = data.State;\n        this.Zip = data.Zip;\n        this.IsResidential = data.IsResidential;\n        this.DPV = data.DPV;\n        this.DPVDesc = data.DPVDesc;\n        this.DPVNotes = data.DPVNotes;\n        this.DPVNotesDesc = data.DPVNotesDesc;\n        this.Corrections = data.Corrections;\n        this.CorrectionsDesc = data.CorrectionsDesc;\n        this.BarcodeDigits = data.BarcodeDigits;\n        this.CarrierRoute = data.CarrierRoute;\n        this.CongressCode = data.CongressCode;\n        this.CountyCode = data.CountyCode;\n        this.CountyName = data.CountyName;\n        this.FragmentHouse = data.FragmentHouse;\n        this.FragmentPreDir = data.FragmentPreDir;\n        this.FragmentStreet = data.FragmentStreet;\n        this.FragmentSuffix = data.FragmentSuffix;\n        this.FragmentPostDir = data.FragmentPostDir;\n        this.FragmentUnit = data.FragmentUnit;\n        this.Fragment = data.Fragment;\n        this.FragmentPMBPrefix = data.FragmentPMBPrefix;\n        this.FragmentPMBNumber = data.FragmentPMBNumber;\n    }\n\n    toString() {\n        return `Address1: ${this.Address1}, ` +\n            `Address2: ${this.Address2}, ` +\n            `City: ${this.City}, ` +\n            `State: ${this.State}, ` +\n            `Zip: ${this.Zip}, ` +\n            `IsResidential: ${this.IsResidential}, ` +\n            `DPV: ${this.DPV}, ` +\n            `DPVDesc: ${this.DPVDesc}, ` +\n            `DPVNotes: ${this.DPVNotes}, ` +\n            `DPVNotesDesc: ${this.DPVNotesDesc}, ` +\n            `Corrections: ${this.Corrections}, ` +\n            `CorrectionsDesc: ${this.CorrectionsDesc}, ` +\n            `BarcodeDigits: ${this.BarcodeDigits}, ` +\n            `CarrierRoute: ${this.CarrierRoute}, ` +\n            `CongressCode: ${this.CongressCode}, ` +\n            `CountyCode: ${this.CountyCode}, ` +\n            `CountyName: ${this.CountyName}, ` +\n            `FragmentHouse: ${this.FragmentHouse}, ` +\n            `FragmentPreDir: ${this.FragmentPreDir}, ` +\n            `FragmentStreet: ${this.FragmentStreet}, ` +\n            `FragmentSuffix: ${this.FragmentSuffix}, ` +\n            `FragmentPostDir: ${this.FragmentPostDir}, ` +\n            `FragmentUnit: ${this.FragmentUnit}, ` +\n            `Fragment: ${this.Fragment}, ` +\n            `FragmentPMBPrefix: ${this.FragmentPMBPrefix}, ` +\n            `FragmentPMBNumber: ${this.FragmentPMBNumber}`;\n    }\n}\n\nexport class Error {\n    constructor(data = {}) {\n        this.Type = data.Type;\n        this.TypeCode = data.TypeCode;\n        this.Desc = data.Desc;\n        this.DescCode = data.DescCode;\n    }\n\n    toString() {\n        return `Type: ${this.Type}, TypeCode: ${this.TypeCode}, Desc: ${this.Desc}, DescCode: ${this.DescCode}`;\n    }\n}\n\nexport class GetBestMatchesResponse {\n    constructor(data = {}) {\n        this.Addresses = (data.Addresses || []).map(address => new Address(address));\n        this.IsCASS = data.IsCASS;\n        this.Error = data.Error ? new Error(data.Error) : null;\n    }\n\n    toString() {\n        const addressesString = this.Addresses.length\n            ? this.Addresses.map(address => address.toString()).join('\\n')\n            : 'None';\n        return `GetBestMatchesResponse:\\n` +\n            `Addresses: [${addressesString}], ` +\n            `IsCASS: ${this.IsCASS}, ` +\n            `Error: ${this.Error ? this.Error.toString() : 'null'}`;\n    }\n}\n\nexport class GetSecondaryNumbersResponse {\n    constructor(data = {}) {\n        this.Address1 = data.Address1;\n        this.City = data.City;\n        this.State = data.State;\n        this.Zip = data.Zip;\n        this.SecondaryNumbers = data.SecondaryNumbers || [];\n        this.TotalCount = data.TotalCount || 0;\n        this.Error = data.Error ? new Error(data.Error) : null;\n    }\n\n    toString() {\n        const secondaryNumbersString = this.SecondaryNumbers.length\n            ? this.SecondaryNumbers.join(', ')\n            : 'None';\n        return `GetSecondaryNumbersResponse:\\n` +\n            `Address1: ${this.Address1}, ` +\n            `City: ${this.City}, ` +\n            `State: ${this.State}, ` +\n            `Zip: ${this.Zip}, ` +\n            `SecondaryNumbers: [${secondaryNumbersString}], ` +\n            `TotalCount: ${this.TotalCount}, ` +\n            `Error: ${this.Error ? this.Error.toString() : 'null'}`;\n    }\n}\n\nexport class CityStateZip {\n    constructor(data = {}) {\n        this.City = data.City;\n        this.State = data.State;\n        this.Zip = data.Zip;\n        this.GeneralDeliveryService = data.GeneralDeliveryService;\n        this.POBoxService = data.POBoxService;\n        this.StreetService = data.StreetService;\n        this.RRHCService = data.RRHCService;\n        this.UrbanizationService = data.UrbanizationService;\n        this.POBoxRangeLow = data.POBoxRangeLow;\n        this.POBoxRangeHigh = data.POBoxRangeHigh;\n        this.IsUniqueZipCode = data.IsUniqueZipCode;\n    }\n\n    toString() {\n        return `City: ${this.City}, ` +\n            `State: ${this.State}, ` +\n            `Zip: ${this.Zip}, ` +\n            `GeneralDeliveryService: ${this.GeneralDeliveryService}, ` +\n            `POBoxService: ${this.POBoxService}, ` +\n            `StreetService: ${this.StreetService}, ` +\n            `RRHCService: ${this.RRHCService}, ` +\n            `UrbanizationService: ${this.UrbanizationService}, ` +\n            `POBoxRangeLow: ${this.POBoxRangeLow}, ` +\n            `POBoxRangeHigh: ${this.POBoxRangeHigh}, ` +\n            `IsUniqueZipCode: ${this.IsUniqueZipCode}`;\n    }\n}\n\nexport class ValidateCityStateZipResponse {\n    constructor(data = {}) {\n        this.CityStateZip = data.CityStateZip ? new CityStateZip(data.CityStateZip) : null;\n        this.Error = data.Error ? new Error(data.Error) : null;\n    }\n\n    toString() {\n        return `ValidateCityStateZipResponse:\\n` +\n            `CityStateZip: ${this.CityStateZip ? this.CityStateZip.toString() : 'null'}, ` +\n            `Error: ${this.Error ? this.Error.toString() : 'null'}`;\n    }\n}\n\nexport class GetBestMatchesSingleLineResponse {\n    constructor(data = {}) {\n        this.Addresses = (data.Addresses || []).map(address => new Address(address));\n        this.IsCASS = data.IsCASS;\n        this.Error = data.Error ? new Error(data.Error) : null;\n    }\n\n    toString() {\n        const addressesString = this.Addresses.length\n            ? this.Addresses.map(address => address.toString()).join('\\n')\n            : 'None';\n        return `GetBestMatchesSingleLineResponse:\\n` +\n            `Addresses: [${addressesString}], ` +\n            `IsCASS: ${this.IsCASS}, ` +\n            `Error: ${this.Error ? this.Error.toString() : 'null'}`;\n    }\n}\n\nexport default {\n    GetBestMatchesResponse,\n    GetSecondaryNumbersResponse,\n    ValidateCityStateZipResponse,\n    GetBestMatchesSingleLineResponse\n};<\/pre>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":21,"featured_media":0,"parent":10830,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-10831","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AV3 \u2013 REST\u00a0<\/title>\n<meta name=\"description\" content=\"C#PythonNodeJS Address Validation 3 C# Rest Code Snippet \ufeffusing System.Threading.Tasks; namespace address_validation_us_3_dot_net.REST { \/\/\/ &lt;summary&gt;\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AV3 \u2013 REST\u00a0\" \/>\n<meta property=\"og:description\" content=\"C#PythonNodeJS Address Validation 3 C# Rest Code Snippet \ufeffusing System.Threading.Tasks; namespace address_validation_us_3_dot_net.REST { \/\/\/ &lt;summary&gt;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/\" \/>\n<meta property=\"og:site_name\" content=\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-10T09:43:36+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/\",\"name\":\"AV3 \u2013 REST\u00a0\",\"isPartOf\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#website\"},\"datePublished\":\"2025-05-21T21:59:16+00:00\",\"dateModified\":\"2025-10-10T09:43:36+00:00\",\"description\":\"C#PythonNodeJS Address Validation 3 C# Rest Code Snippet \ufeffusing System.Threading.Tasks; namespace address_validation_us_3_dot_net.REST { \/\/\/ &lt;summary>\",\"breadcrumb\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DOTS Address Validation &#8211; US 3\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"AV3 &#8211; Code Snippets and Sample Code\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"AV3 \u2013 REST\u00a0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#website\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/\",\"name\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.serviceobjects.com\/docs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#organization\",\"name\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png\",\"contentUrl\":\"https:\/\/www.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png\",\"width\":2560,\"height\":1440,\"caption\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\"},\"image\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AV3 \u2013 REST\u00a0","description":"C#PythonNodeJS Address Validation 3 C# Rest Code Snippet \ufeffusing System.Threading.Tasks; namespace address_validation_us_3_dot_net.REST { \/\/\/ &lt;summary>","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/","og_locale":"en_US","og_type":"article","og_title":"AV3 \u2013 REST\u00a0","og_description":"C#PythonNodeJS Address Validation 3 C# Rest Code Snippet \ufeffusing System.Threading.Tasks; namespace address_validation_us_3_dot_net.REST { \/\/\/ &lt;summary>","og_url":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/","og_site_name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","article_modified_time":"2025-10-10T09:43:36+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/","url":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/","name":"AV3 \u2013 REST\u00a0","isPartOf":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#website"},"datePublished":"2025-05-21T21:59:16+00:00","dateModified":"2025-10-10T09:43:36+00:00","description":"C#PythonNodeJS Address Validation 3 C# Rest Code Snippet \ufeffusing System.Threading.Tasks; namespace address_validation_us_3_dot_net.REST { \/\/\/ &lt;summary>","breadcrumb":{"@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/av3-rest\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.serviceobjects.com\/docs\/"},{"@type":"ListItem","position":2,"name":"DOTS Address Validation &#8211; US 3","item":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/"},{"@type":"ListItem","position":3,"name":"AV3 &#8211; Code Snippets and Sample Code","item":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-3\/av3-code-snippets-and-sample-code\/"},{"@type":"ListItem","position":4,"name":"AV3 \u2013 REST\u00a0"}]},{"@type":"WebSite","@id":"https:\/\/www.serviceobjects.com\/docs\/#website","url":"https:\/\/www.serviceobjects.com\/docs\/","name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","description":"","publisher":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.serviceobjects.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.serviceobjects.com\/docs\/#organization","name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","url":"https:\/\/www.serviceobjects.com\/docs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.serviceobjects.com\/docs\/#\/schema\/logo\/image\/","url":"https:\/\/www.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png","contentUrl":"https:\/\/www.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png","width":2560,"height":1440,"caption":"Service Objects | Contact, Phone, Email Verification | Data Quality Services"},"image":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/10831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/comments?post=10831"}],"version-history":[{"count":12,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/10831\/revisions"}],"predecessor-version":[{"id":12398,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/10831\/revisions\/12398"}],"up":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/10830"}],"wp:attachment":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/media?parent=10831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}