{"id":2497,"date":"2022-11-09T07:20:00","date_gmt":"2022-11-09T07:20:00","guid":{"rendered":"https:\/\/serviceobjects.wpaladdin.com\/?post_type=serviceobjects&#038;p=2497"},"modified":"2025-09-27T16:10:00","modified_gmt":"2025-09-27T23:10:00","slug":"aius-rest","status":"publish","type":"page","link":"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/","title":{"rendered":"AIUS &#8211; REST"},"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 Insight 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=\"\">\ufeff\ufeffusing System.Web;\n\nnamespace address_insight_us_dot_net.REST\n{\n    \/\/\/ &lt;summary>\n    \/\/\/ Provides functionality to call the ServiceObjects AddressInsight (AIN) REST API's GetAddressInsight endpoint,\n    \/\/\/ retrieving address validation, geocoding, and demographic information for a given US address\n    \/\/\/ with fallback to a backup endpoint for reliability in live mode.\n    \/\/\/ &lt;\/summary>\n    public class GetAddressInsightClient\n    {\n        \/\/ Base URL constants: production, backup, and trial\n        private const string LiveBaseUrl = \"https:\/\/sws.serviceobjects.com\/ain\/api.svc\/json\/\";\n        private const string BackupBaseUrl = \"https:\/\/swsbackup.serviceobjects.com\/ain\/api.svc\/json\/\";\n        private const string TrialBaseUrl = \"https:\/\/trial.serviceobjects.com\/ain\/api.svc\/json\/\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Synchronously calls the GetAddressInsight REST endpoint to retrieve address insight information,\n        \/\/\/ attempting the primary endpoint first and falling back to the backup if the response is invalid\n        \/\/\/ (Error.TypeCode == \"3\") in live mode.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"input\">The input parameters including business name, address, city, state, zip, test type, and license key.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"AINResponse\"\/> containing address insight data or an error.&lt;\/returns>\n        public static AINResponse Invoke(GetAddressInsightInput input)\n        {\n            \/\/ Use query string parameters so missing\/optional fields don't break the URL\n            string url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            AINResponse response = Helper.HttpGet&lt;AINResponse>(url, input.TimeoutSeconds);\n\n            \/\/ Fallback on error in live mode\n            if (input.IsLive &amp;&amp; !IsValid(response))\n            {\n                string fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                AINResponse fallbackResponse = Helper.HttpGet&lt;AINResponse>(fallbackUrl, input.TimeoutSeconds);\n                return fallbackResponse;\n            }\n\n            return response;\n        }\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Asynchronously calls the GetAddressInsight REST endpoint to retrieve address insight information,\n        \/\/\/ attempting the primary endpoint first and falling back to the backup if the response is invalid\n        \/\/\/ (Error.TypeCode == \"3\") in live mode.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"input\">The input parameters including business name, address, city, state, zip, test type, and license key.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"AINResponse\"\/> containing address insight data or an error.&lt;\/returns>\n        public static async Task&lt;AINResponse> InvokeAsync(GetAddressInsightInput input)\n        {\n            \/\/ Use query string parameters so missing\/optional fields don't break the URL\n            string url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            AINResponse response = await Helper.HttpGetAsync&lt;AINResponse>(url, input.TimeoutSeconds).ConfigureAwait(false);\n\n            \/\/ Fallback on error in live mode\n            if (input.IsLive &amp;&amp; !IsValid(response))\n            {\n                string fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                AINResponse fallbackResponse = await Helper.HttpGetAsync&lt;AINResponse>(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(GetAddressInsightInput input, string baseUrl)\n        {\n            \/\/ Construct query string with URL-encoded parameters\n            string qs = $\"GetAddressInsight?\" +\n                        $\"BusinessName={Helper.UrlEncode(input.BusinessName)}\" +\n                        $\"&amp;Address1={Helper.UrlEncode(input.Address1)}\" +\n                        $\"&amp;Address2={Helper.UrlEncode(input.Address2)}\" +\n                        $\"&amp;City={Helper.UrlEncode(input.City)}\" +\n                        $\"&amp;State={Helper.UrlEncode(input.State)}\" +\n                        $\"&amp;Zip={Helper.UrlEncode(input.Zip)}\" +\n                        $\"&amp;TestType={Helper.UrlEncode(input.TestType)}\" +\n                        $\"&amp;LicenseKey={Helper.UrlEncode(input.LicenseKey)}\";\n            return baseUrl + qs;\n        }\n\n        private static bool IsValid(AINResponse response) => response?.Error == null || response.Error.TypeCode != \"3\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Input parameters for the GetAddressInsight API call. Represents a US address to retrieve address insights\n        \/\/\/ with cascading logic for partial matches.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"BusinessName\">A company name for a business, can provide additional insight or append a SuiteLink value. Optional.&lt;\/param>\n        \/\/\/ &lt;param name=\"Address1\">Address line 1 of the contact or business address (e.g., \"123 Main Street\").&lt;\/param>\n        \/\/\/ &lt;param name=\"Address2\">Address line 2 of the contact or business address (e.g., \"Apt 4B\"). Optional.&lt;\/param>\n        \/\/\/ &lt;param name=\"City\">The city of the address (e.g., \"New York\"). Optional if zip is provided.&lt;\/param>\n        \/\/\/ &lt;param name=\"State\">The state of the address (e.g., \"NY\"). Optional if zip is provided.&lt;\/param>\n        \/\/\/ &lt;param name=\"Zip\">The ZIP code of the address. Optional if city and state are provided.&lt;\/param>\n        \/\/\/ &lt;param name=\"TestType\">The test type, either empty or \"census_loose\" for best possible match based on census data. Optional.&lt;\/param>\n        \/\/\/ &lt;param name=\"LicenseKey\">The license key to authenticate the API request.&lt;\/param>\n        \/\/\/ &lt;param name=\"IsLive\">Indicates whether to use the live service (true) or trial service (false).&lt;\/param>\n        \/\/\/ &lt;param name=\"TimeoutSeconds\">Timeout duration for the API call, in seconds.&lt;\/param>\n        public record GetAddressInsightInput(\n            string BusinessName = \"\",\n            string Address1 = \"\",\n            string Address2 = \"\",\n            string City = \"\",\n            string State = \"\",\n            string Zip = \"\",\n            string TestType = \"\",\n            string LicenseKey = \"\",\n            bool IsLive = true,\n            int TimeoutSeconds = 15\n        );\n    }\n}\n\n\n\n\/\/\/ &lt;summary>\n\/\/\/ This is the return from the AIN endpoint\n\/\/\/ &lt;\/summary>\n\/\/\/\npublic class AINResponse\n{\n    public string Status { get; set; }\n    public string StatusScore { get; set; }\n    public string AddressStatus { get; set; }\n    public string DPV { get; set; }\n    public string DPVDesc { get; set; }\n    public string Address { get; set; }\n    public string AddressExtra { get; set; }\n    public string City { get; set; }\n    public string State { get; set; }\n    public string Zip { get; set; }\n    public string BarcodeDigits { get; set; }\n    public string CarrierRoute { get; set; }\n    public string CongressCode { get; set; }\n    public string CountyCode { get; set; }\n    public string CountyName { get; set; }\n    public string FragmentHouse { get; set; }\n    public string FragmentPreDir { get; set; }\n    public string FragmentStreet { get; set; }\n    public string FragmentSuffix { get; set; }\n    public string FragmentPostDir { get; set; }\n    public string FragmentUnit { get; set; }\n    public string FragmentUnitNumber { get; set; }\n    public string Fragment { get; set; }\n    public string FragmentPMBPrefix { get; set; }\n    public string FragmentPMBNumber { get; set; }\n    public string Corrections { get; set; }\n    public string CorrectionsDesc { get; set; }\n    public string AddressNotes { get; set; }\n    public string AddressNotesCodes { get; set; }\n    public string GeocodeStatus { get; set; }\n    public string LocationLatitude { get; set; }\n    public string LocationLongitude { get; set; }\n    public string CensusTract { get; set; }\n    public string CensusBlock { get; set; }\n    public string PlaceName { get; set; }\n    public string ClassFP { get; set; }\n    public string SLDUST { get; set; }\n    public string SLDLST { get; set; }\n    public string CountyFIPS { get; set; }\n    public string StateFIPS { get; set; }\n    public string GeocodeNotes { get; set; }\n    public string GeocodeNotesCodes { get; set; }\n    public string ZipStatus { get; set; }\n    public string ZipLatitude { get; set; }\n    public string ZipLongitude { get; set; }\n    public string CityType { get; set; }\n    public string CityAliasName { get; set; }\n    public string AreaCode { get; set; }\n    public string TimeZone { get; set; }\n    public string DaylightSaving { get; set; }\n    public string MSA { get; set; }\n    public string CBSA { get; set; }\n    public string CBSA_Div { get; set; }\n    public string PMSA { get; set; }\n    public string DMA { get; set; }\n    public string ZipHouseholdValue { get; set; }\n    public string ZipPersonsPerHousehold { get; set; }\n    public string ZipHouseholdIncome { get; set; }\n    public string CountyHouseholdIncome { get; set; }\n    public string StateHouseholdIncome { get; set; }\n    public string ZipNotes { get; set; }\n    public string ZipNotesCodes { get; set; }\n    public string Debug { get; set; }\n    public Error Error { get; set; }\n    public override string ToString()\n    {\n        return $\"\\n{{\\n\\tStatus: {Status}\\n\\t\" +\n            $\"StatusScore: {StatusScore}\\n\\t\" +\n            $\"AddressStatus: {AddressStatus}\\n\\t\" +\n            $\"DPV: {DPV}\\n\\t\" +\n            $\"DPVDesc: {DPVDesc}\\n\\t\" +\n            $\"Address: {Address}\\n\\t\" +\n            $\"AddressExtra: {AddressExtra}\\n\\t\" +\n            $\"City: {City}\\n\\t\" +\n            $\"State: {State}\\n\\t\" +\n            $\"Zip: {Zip}\\n\\t\" +\n            $\"BarcodeDigits: {BarcodeDigits}\\n\\t\" +\n            $\"CarrierRoute: {CarrierRoute}\\n\\t\" +\n            $\"CongressCode: {CongressCode}\\n\\t\" +\n            $\"CountyCode: {CountyCode}\\n\\t\" +\n            $\"CountyName: {CountyName}\\n\\t\" +\n            $\"FragmentHouse: {FragmentHouse}\\n\\t\" +\n            $\"FragmentPreDir: {FragmentPreDir}\\n\\t\" +\n            $\"FragmentStreet: {FragmentStreet}\\n\\t\" +\n            $\"FragmentSuffix: {FragmentSuffix}\\n\\t\" +\n            $\"FragmentPostDir: {FragmentPostDir}\\n\\t\" +\n            $\"FragmentUnit: {FragmentUnit}\\n\\t\" +\n            $\"FragmentUnitNumber: {FragmentUnitNumber}\\n\\t\" +\n            $\"FragmentPMBPrefix: {FragmentPMBPrefix}\\n\\t\" +\n            $\"FragmentPMBNumber: {FragmentPMBNumber}\\n\\t\" +\n            $\"Corrections: {Corrections}\\n\\t\" +\n            $\"CorrectionsDesc: {CorrectionsDesc}\\n\\t\" +\n            $\"AddressNotes: {AddressNotes}\\n\\t\" +\n            $\"AddressNotesCodes: {AddressNotesCodes}\\n\\t\" +\n            $\"GeocodeStatus: {GeocodeStatus}\\n\\t\" +\n            $\"LocationLatitude: {LocationLatitude}\\n\\t\" +\n            $\"LocationLongitude: {LocationLongitude}\\n\\t\" +\n            $\"CensusTract: {CensusTract}\\n\\t\" +\n            $\"CensusBlock: {CensusBlock}\\n\\t\" +\n            $\"PlaceName: {PlaceName}\\n\\t\" +\n            $\"ClassFP: {ClassFP}\\n\\t\" +\n            $\"SLDUST: {SLDUST}\\n\\t\" +\n            $\"SLDLST: {SLDLST}\\n\\t\" +\n            $\"CountyFIPS: {CountyFIPS}\\n\\t\" +\n            $\"StateFIPS: {StateFIPS}\\n\\t\" +\n            $\"GeocodeNotes: {GeocodeNotes}\\n\\t\" +\n            $\"GeocodeNotesCodes: {GeocodeNotesCodes}\\n\\t\" +\n            $\"ZipStatus: {ZipStatus}\\n\\t\" +\n            $\"ZipLatitude: {ZipLatitude}\\n\\t\" +\n            $\"ZipLongitude: {ZipLongitude}\\n\\t\" +\n            $\"CityType: {CityType}\\n\\t\" +\n            $\"CityAliasName: {CityAliasName}\\n\\t\" +\n            $\"AreaCode: {AreaCode}\\n\\t\" +\n            $\"TimeZone: {TimeZone}\\n\\t\" +\n            $\"DaylightSaving: {DaylightSaving}\\n\\t\" +\n            $\"MSA: {MSA}\\n\\t\" +\n            $\"CBSA: {CBSA}\\n\\t\" +\n            $\"CBSA_Div: {CBSA_Div}\\n\\t\" +\n            $\"PMSA: {PMSA}\\n\\t\" +\n            $\"DMA: {DMA}\\n\\t\" +\n            $\"ZipHouseholdValue: {ZipHouseholdValue}\\n\\t\" +\n            $\"ZipPersonsPerHousehold: {ZipPersonsPerHousehold}\\n\\t\" +\n            $\"ZipHouseholdIncome: {ZipHouseholdIncome}\\n\\t\" +\n            $\"CountyHouseholdIncome: {CountyHouseholdIncome}\\n\\t\" +\n            $\"StateHouseholdIncome: {StateHouseholdIncome}\\n\\t\" +\n            $\"ZipNotes: {ZipNotes}\\n\\t\" +\n            $\"ZipNotesCodes: {ZipNotesCodes}\\n\\t\" +\n            $\"Error: {{{Error}}}\\n}}\";\n    }\n}\n\npublic class Error\n{\n    public string Type { get; set; }\n    public string TypeCode { get; set; }\n    public string Desc { get; set; }\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\ufeffusing System.Text.Json;\nusing System.Web;\n\nnamespace address_insight_us_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 Insight Python<\/strong> <strong>Rest 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=\"\">from ain_response import AINResponse, Error\nimport requests\n\n# Endpoint URLs for ServiceObjects AddressInsight (AIN) API\nprimary_url = \"https:\/\/sws.serviceobjects.com\/ain\/api.svc\/json\/GetAddressInsight?\"\nbackup_url = \"https:\/\/swsbackup.serviceobjects.com\/ain\/api.svc\/json\/GetAddressInsight?\"\ntrial_url = \"https:\/\/trial.serviceobjects.com\/ain\/api.svc\/json\/GetAddressInsight?\"\n\ndef get_address_insight(\n    business_name: str,\n    address1: str,\n    address2: str,\n    city: str,\n    state: str,\n    zip_code: str,\n    test_type: str,\n    license_key: str,\n    is_live: bool = True\n) -> AINResponse:\n    \"\"\"\n    Call ServiceObjects AddressInsight (AIN) API's GetAddressInsight endpoint\n    to retrieve address validation, geocoding, and demographic information for a given US address.\n\n    Parameters:\n        business_name: A company name for a business, can provide additional insight or append a SuiteLink value. Optional.\n        address1: Address line 1 of the contact or business address (e.g., \"123 Main Street\").\n        address2: Address line 2 of the contact or business address (e.g., \"Apt 4B\"). Optional.\n        city: The city of the address (e.g., \"New York\"). Optional if zip is provided.\n        state: The state of the address (e.g., \"NY\"). Optional if zip is provided.\n        zip_code: The ZIP code of the address. Optional if city and state are provided.\n        test_type: The test type, either empty or \"census_loose\" for best possible match based on census data. Optional.\n        license_key: Your ServiceObjects license key.\n        is_live: Use live or trial servers.\n\n    Returns:\n        AINResponse: Parsed JSON response with address insight results 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    params = {\n        \"BusinessName\": business_name,\n        \"Address1\": address1,\n        \"Address2\": address2,\n        \"City\": city,\n        \"State\": state,\n        \"Zip\": zip_code,\n        \"TestType\": test_type,\n        \"LicenseKey\": license_key,\n    }\n    # Select the base URL: production vs trial\n    url = primary_url if is_live else trial_url\n\n    try:\n        # Attempt primary (or trial) endpoint\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 = data.get('Error')\n        if not (error is None or error.get('TypeCode') != \"3\"):\n            if is_live:\n                # Try backup URL\n                response = requests.get(backup_url, params=params, timeout=10)\n                response.raise_for_status()\n                data = response.json()\n\n                # If still error, propagate exception\n                if 'Error' in data:\n                    raise RuntimeError(f\"AddressInsight service error: {data['Error']}\")\n            else:\n                # Trial mode error is terminal\n                raise RuntimeError(f\"AddressInsight trial error: {data['Error']}\")\n\n        # Convert JSON response to AINResponse for structured access\n        error = Error(**data.get(\"Error\", {})) if data.get(\"Error\") else None\n\n        return AINResponse(\n            Status=data.get(\"Status\"),\n            StatusScore=data.get(\"StatusScore\"),\n            AddressStatus=data.get(\"AddressStatus\"),\n            DPV=data.get(\"DPV\"),\n            DPVDesc=data.get(\"DPVDesc\"),\n            Address=data.get(\"Address\"),\n            AddressExtra=data.get(\"AddressExtra\"),\n            City=data.get(\"City\"),\n            State=data.get(\"State\"),\n            Zip=data.get(\"Zip\"),\n            BarcodeDigits=data.get(\"BarcodeDigits\"),\n            CarrierRoute=data.get(\"CarrierRoute\"),\n            CongressCode=data.get(\"CongressCode\"),\n            CountyCode=data.get(\"CountyCode\"),\n            CountyName=data.get(\"CountyName\"),\n            FragmentHouse=data.get(\"FragmentHouse\"),\n            FragmentPreDir=data.get(\"FragmentPreDir\"),\n            FragmentStreet=data.get(\"FragmentStreet\"),\n            FragmentSuffix=data.get(\"FragmentSuffix\"),\n            FragmentPostDir=data.get(\"FragmentPostDir\"),\n            FragmentUnit=data.get(\"FragmentUnit\"),\n            FragmentUnitNumber=data.get(\"FragmentUnitNumber\"),\n            Fragment=data.get(\"Fragment\"),\n            FragmentPMBPrefix=data.get(\"FragmentPMBPrefix\"),\n            FragmentPMBNumber=data.get(\"FragmentPMBNumber\"),\n            Corrections=data.get(\"Corrections\"),\n            CorrectionsDesc=data.get(\"CorrectionsDesc\"),\n            AddressNotes=data.get(\"AddressNotes\"),\n            AddressNotesCodes=data.get(\"AddressNotesCodes\"),\n            GeocodeStatus=data.get(\"GeocodeStatus\"),\n            LocationLatitude=data.get(\"LocationLatitude\"),\n            LocationLongitude=data.get(\"LocationLongitude\"),\n            CensusTract=data.get(\"CensusTract\"),\n            CensusBlock=data.get(\"CensusBlock\"),\n            PlaceName=data.get(\"PlaceName\"),\n            ClassFP=data.get(\"ClassFP\"),\n            SLDUST=data.get(\"SLDUST\"),\n            SLDLST=data.get(\"SLDLST\"),\n            CountyFIPS=data.get(\"CountyFIPS\"),\n            StateFIPS=data.get(\"StateFIPS\"),\n            GeocodeNotes=data.get(\"GeocodeNotes\"),\n            GeocodeNotesCodes=data.get(\"GeocodeNotesCodes\"),\n            ZipStatus=data.get(\"ZipStatus\"),\n            ZipLatitude=data.get(\"ZipLatitude\"),\n            ZipLongitude=data.get(\"ZipLongitude\"),\n            CityType=data.get(\"CityType\"),\n            CityAliasName=data.get(\"CityAliasName\"),\n            AreaCode=data.get(\"AreaCode\"),\n            TimeZone=data.get(\"TimeZone\"),\n            DaylightSaving=data.get(\"DaylightSaving\"),\n            MSA=data.get(\"MSA\"),\n            CBSA=data.get(\"CBSA\"),\n            CBSA_Div=data.get(\"CBSA_Div\"),\n            PMSA=data.get(\"PMSA\"),\n            DMA=data.get(\"DMA\"),\n            ZipHouseholdValue=data.get(\"ZipHouseholdValue\"),\n            ZipPersonsPerHousehold=data.get(\"ZipPersonsPerHousehold\"),\n            ZipHouseholdIncome=data.get(\"ZipHouseholdIncome\"),\n            CountyHouseholdIncome=data.get(\"CountyHouseholdIncome\"),\n            StateHouseholdIncome=data.get(\"StateHouseholdIncome\"),\n            ZipNotes=data.get(\"ZipNotes\"),\n            ZipNotesCodes=data.get(\"ZipNotesCodes\"),\n            Debug=data.get(\"Debug\", []),\n            Error=error\n        )\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\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\"AddressInsight backup error: {data['Error']}\") from req_exc\n\n                error = Error(**data.get(\"Error\", {})) if data.get(\"Error\") else None\n\n                return AINResponse(\n                    Status=data.get(\"Status\"),\n                    StatusScore=data.get(\"StatusScore\"),\n                    AddressStatus=data.get(\"AddressStatus\"),\n                    DPV=data.get(\"DPV\"),\n                    DPVDesc=data.get(\"DPVDesc\"),\n                    Address=data.get(\"Address\"),\n                    AddressExtra=data.get(\"AddressExtra\"),\n                    City=data.get(\"City\"),\n                    State=data.get(\"State\"),\n                    Zip=data.get(\"Zip\"),\n                    BarcodeDigits=data.get(\"BarcodeDigits\"),\n                    CarrierRoute=data.get(\"CarrierRoute\"),\n                    CongressCode=data.get(\"CongressCode\"),\n                    CountyCode=data.get(\"CountyCode\"),\n                    CountyName=data.get(\"CountyName\"),\n                    FragmentHouse=data.get(\"FragmentHouse\"),\n                    FragmentPreDir=data.get(\"FragmentPreDir\"),\n                    FragmentStreet=data.get(\"FragmentStreet\"),\n                    FragmentSuffix=data.get(\"FragmentSuffix\"),\n                    FragmentPostDir=data.get(\"FragmentPostDir\"),\n                    FragmentUnit=data.get(\"FragmentUnit\"),\n                    FragmentUnitNumber=data.get(\"FragmentUnitNumber\"),\n                    Fragment=data.get(\"Fragment\"),\n                    FragmentPMBPrefix=data.get(\"FragmentPMBPrefix\"),\n                    FragmentPMBNumber=data.get(\"FragmentPMBNumber\"),\n                    Corrections=data.get(\"Corrections\"),\n                    CorrectionsDesc=data.get(\"CorrectionsDesc\"),\n                    AddressNotes=data.get(\"AddressNotes\"),\n                    AddressNotesCodes=data.get(\"AddressNotesCodes\"),\n                    GeocodeStatus=data.get(\"GeocodeStatus\"),\n                    LocationLatitude=data.get(\"LocationLatitude\"),\n                    LocationLongitude=data.get(\"LocationLongitude\"),\n                    CensusTract=data.get(\"CensusTract\"),\n                    CensusBlock=data.get(\"CensusBlock\"),\n                    PlaceName=data.get(\"PlaceName\"),\n                    ClassFP=data.get(\"ClassFP\"),\n                    SLDUST=data.get(\"SLDUST\"),\n                    SLDLST=data.get(\"SLDLST\"),\n                    CountyFIPS=data.get(\"CountyFIPS\"),\n                    StateFIPS=data.get(\"StateFIPS\"),\n                    GeocodeNotes=data.get(\"GeocodeNotes\"),\n                    GeocodeNotesCodes=data.get(\"GeocodeNotesCodes\"),\n                    ZipStatus=data.get(\"ZipStatus\"),\n                    ZipLatitude=data.get(\"ZipLatitude\"),\n                    ZipLongitude=data.get(\"ZipLongitude\"),\n                    CityType=data.get(\"CityType\"),\n                    CityAliasName=data.get(\"CityAliasName\"),\n                    AreaCode=data.get(\"AreaCode\"),\n                    TimeZone=data.get(\"TimeZone\"),\n                    DaylightSaving=data.get(\"DaylightSaving\"),\n                    MSA=data.get(\"MSA\"),\n                    CBSA=data.get(\"CBSA\"),\n                    CBSA_Div=data.get(\"CBSA_Div\"),\n                    PMSA=data.get(\"PMSA\"),\n                    DMA=data.get(\"DMA\"),\n                    ZipHouseholdValue=data.get(\"ZipHouseholdValue\"),\n                    ZipPersonsPerHousehold=data.get(\"ZipPersonsPerHousehold\"),\n                    ZipHouseholdIncome=data.get(\"ZipHouseholdIncome\"),\n                    CountyHouseholdIncome=data.get(\"CountyHouseholdIncome\"),\n                    StateHouseholdIncome=data.get(\"StateHouseholdIncome\"),\n                    ZipNotes=data.get(\"ZipNotes\"),\n                    ZipNotesCodes=data.get(\"ZipNotesCodes\"),\n                    Debug=data.get(\"Debug\", []),\n                    Error=error\n                )\n            except Exception as backup_exc:\n                raise RuntimeError(\"AddressInsight service unreachable on both endpoints\") from backup_exc\n        else:\n            raise RuntimeError(f\"AddressInsight trial error: {str(req_exc)}\") from req_exc\n\n\n\nfrom dataclasses import dataclass\nfrom typing import Optional, List\n\n@dataclass\nclass Error:\n    Type: Optional[str] = None\n    TypeCode: Optional[str] = None\n    Desc: Optional[str] = None\n    DescCode: Optional[str] = None\n\n    def __str__(self) -> str:\n        return f\"Error: Type={self.Type}, TypeCode={self.TypeCode}, Desc={self.Desc}, DescCode={self.DescCode}\"\n\n@dataclass\nclass AINResponse:\n    Status: Optional[str] = None\n    StatusScore: Optional[str] = None\n    AddressStatus: Optional[str] = None\n    DPV: Optional[str] = None\n    DPVDesc: Optional[str] = None\n    Address: Optional[str] = None\n    AddressExtra: Optional[str] = None\n    City: Optional[str] = None\n    State: Optional[str] = None\n    Zip: Optional[str] = None\n    BarcodeDigits: Optional[str] = None\n    CarrierRoute: Optional[str] = None\n    CongressCode: Optional[str] = None\n    CountyCode: Optional[str] = None\n    CountyName: Optional[str] = None\n    FragmentHouse: Optional[str] = None\n    FragmentPreDir: Optional[str] = None\n    FragmentStreet: Optional[str] = None\n    FragmentSuffix: Optional[str] = None\n    FragmentPostDir: Optional[str] = None\n    FragmentUnit: Optional[str] = None\n    FragmentUnitNumber: Optional[str] = None\n    Fragment: Optional[str] = None\n    FragmentPMBPrefix: Optional[str] = None\n    FragmentPMBNumber: Optional[str] = None\n    Corrections: Optional[str] = None\n    CorrectionsDesc: Optional[str] = None\n    AddressNotes: Optional[str] = None\n    AddressNotesCodes: Optional[str] = None\n    GeocodeStatus: Optional[str] = None\n    LocationLatitude: Optional[str] = None\n    LocationLongitude: Optional[str] = None\n    CensusTract: Optional[str] = None\n    CensusBlock: Optional[str] = None\n    PlaceName: Optional[str] = None\n    ClassFP: Optional[str] = None\n    SLDUST: Optional[str] = None\n    SLDLST: Optional[str] = None\n    CountyFIPS: Optional[str] = None\n    StateFIPS: Optional[str] = None\n    GeocodeNotes: Optional[str] = None\n    GeocodeNotesCodes: Optional[str] = None\n    ZipStatus: Optional[str] = None\n    ZipLatitude: Optional[str] = None\n    ZipLongitude: Optional[str] = None\n    CityType: Optional[str] = None\n    CityAliasName: Optional[str] = None\n    AreaCode: Optional[str] = None\n    TimeZone: Optional[str] = None\n    DaylightSaving: Optional[str] = None\n    MSA: Optional[str] = None\n    CBSA: Optional[str] = None\n    CBSA_Div: Optional[str] = None\n    PMSA: Optional[str] = None\n    DMA: Optional[str] = None\n    ZipHouseholdValue: Optional[str] = None\n    ZipPersonsPerHousehold: Optional[str] = None\n    ZipHouseholdIncome: Optional[str] = None\n    CountyHouseholdIncome: Optional[str] = None\n    StateHouseholdIncome: Optional[str] = None\n    ZipNotes: Optional[str] = None\n    ZipNotesCodes: Optional[str] = None\n    Debug: Optional[List[str]] = None\n    Error: Optional['Error'] = None\n\n    def __post_init__(self):\n        if self.Debug is None:\n            self.Debug = []\n\n    def __str__(self) -> str:\n        debug_string = ', '.join(self.Debug) if self.Debug else 'None'\n        error = str(self.Error) if self.Error else 'None'\n        return (f\"AINResponse: Status={self.Status}, StatusScore={self.StatusScore}, AddressStatus={self.AddressStatus}, \"\n                f\"DPV={self.DPV}, DPVDesc={self.DPVDesc}, Address={self.Address}, AddressExtra={self.AddressExtra}, \"\n                f\"City={self.City}, State={self.State}, Zip={self.Zip}, BarcodeDigits={self.BarcodeDigits}, \"\n                f\"CarrierRoute={self.CarrierRoute}, CongressCode={self.CongressCode}, CountyCode={self.CountyCode}, \"\n                f\"CountyName={self.CountyName}, FragmentHouse={self.FragmentHouse}, FragmentPreDir={self.FragmentPreDir}, \"\n                f\"FragmentStreet={self.FragmentStreet}, FragmentSuffix={self.FragmentSuffix}, FragmentPostDir={self.FragmentPostDir}, \"\n                f\"FragmentUnit={self.FragmentUnit}, FragmentUnitNumber={self.FragmentUnitNumber}, Fragment={self.Fragment}, \"\n                f\"FragmentPMBPrefix={self.FragmentPMBPrefix}, FragmentPMBNumber={self.FragmentPMBNumber}, \"\n                f\"Corrections={self.Corrections}, CorrectionsDesc={self.CorrectionsDesc}, AddressNotes={self.AddressNotes}, \"\n                f\"AddressNotesCodes={self.AddressNotesCodes}, GeocodeStatus={self.GeocodeStatus}, LocationLatitude={self.LocationLatitude}, \"\n                f\"LocationLongitude={self.LocationLongitude}, CensusTract={self.CensusTract}, CensusBlock={self.CensusBlock}, \"\n                f\"PlaceName={self.PlaceName}, ClassFP={self.ClassFP}, SLDUST={self.SLDUST}, SLDLST={self.SLDLST}, \"\n                f\"CountyFIPS={self.CountyFIPS}, StateFIPS={self.StateFIPS}, GeocodeNotes={self.GeocodeNotes}, \"\n                f\"GeocodeNotesCodes={self.GeocodeNotesCodes}, ZipStatus={self.ZipStatus}, ZipLatitude={self.ZipLatitude}, \"\n                f\"ZipLongitude={self.ZipLongitude}, CityType={self.CityType}, CityAliasName={self.CityAliasName}, \"\n                f\"AreaCode={self.AreaCode}, TimeZone={self.TimeZone}, DaylightSaving={self.DaylightSaving}, \"\n                f\"MSA={self.MSA}, CBSA={self.CBSA}, CBSA_Div={self.CBSA_Div}, PMSA={self.PMSA}, DMA={self.DMA}, \"\n                f\"ZipHouseholdValue={self.ZipHouseholdValue}, ZipPersonsPerHousehold={self.ZipPersonsPerHousehold}, \"\n                f\"ZipHouseholdIncome={self.ZipHouseholdIncome}, CountyHouseholdIncome={self.CountyHouseholdIncome}, \"\n                f\"StateHouseholdIncome={self.StateHouseholdIncome}, ZipNotes={self.ZipNotes}, ZipNotesCodes={self.ZipNotesCodes}, \"\n                f\"Debug=[{debug_string}], Error={error}\")<\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong>Address Insight NodeJS<\/strong> <strong>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 { AINResponse } from '.\/ain_response.js';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the live ServiceObjects AddressInsight (AIN) API service.\n *\/\nconst LiveBaseUrl = 'https:\/\/sws.serviceobjects.com\/ain\/api.svc\/json\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the backup ServiceObjects AddressInsight (AIN) API service.\n *\/\nconst BackupBaseUrl = 'https:\/\/swsbackup.serviceobjects.com\/ain\/api.svc\/json\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the trial ServiceObjects AddressInsight (AIN) API service.\n *\/\nconst TrialBaseUrl = 'https:\/\/trial.serviceobjects.com\/ain\/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 GetAddressInsight 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}GetAddressInsight?${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;AINResponse>\">A promise that resolves to a AINResponse 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 AINResponse(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 AddressInsight (AIN) API's GetAddressInsight endpoint,\n * retrieving address validation, geocoding, and demographic information for a given US address\n * with fallback to a backup endpoint for reliability in live mode.\n * &lt;\/summary>\n *\/\nconst GetAddressInsightClient = {\n    \/**\n     * &lt;summary>\n     * Asynchronously invokes the GetAddressInsight 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 - A company name for a business, can provide additional insight or append a SuiteLink value. Optional.\n     * @param {string} Address1 - Address line 1 of the contact or business address (e.g., \"123 Main Street\").\n     * @param {string} Address2 - Address line 2 of the contact or business address (e.g., \"Apt 4B\"). Optional.\n     * @param {string} City - The city of the address (e.g., \"New York\"). Optional if zip is provided.\n     * @param {string} State - The state of the address (e.g., \"NY\"). Optional if zip is provided.\n     * @param {string} Zip - The ZIP code of the address. Optional if city and state are provided.\n     * @param {string} TestType - The test type, either empty or \"census_loose\" for best possible match based on census data. Optional.\n     * @param {string} LicenseKey - Your license key to use the service.\n     * @param {boolean} isLive - Value to determine whether to use the live or trial servers.\n     * @param {number} timeoutSeconds - Timeout, in seconds, for the call to the service.\n     * @returns {Promise&lt;AINResponse>} - A promise that resolves to a AINResponse object.\n     *\/\n    async invokeAsync(BusinessName, Address1, Address2, City, State, Zip, TestType, LicenseKey, isLive = true, timeoutSeconds = 15) {\n        const params = {\n            BusinessName,\n            Address1,\n            Address2,\n            City,\n            State,\n            Zip,\n            TestType,\n            LicenseKey\n        };\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 GetAddressInsight API endpoint by wrapping the async call\n     * and awaiting its result immediately.\n     * &lt;\/summary>\n     * @param {string} BusinessName - A company name for a business, can provide additional insight or append a SuiteLink value. Optional.\n     * @param {string} Address1 - Address line 1 of the contact or business address (e.g., \"123 Main Street\").\n     * @param {string} Address2 - Address line 2 of the contact or business address (e.g., \"Apt 4B\"). Optional.\n     * @param {string} City - The city of the address (e.g., \"New York\"). Optional if zip is provided.\n     * @param {string} State - The state of the address (e.g., \"NY\"). Optional if zip is provided.\n     * @param {string} Zip - The ZIP code of the address. Optional if city and state are provided.\n     * @param {string} TestType - The test type, either empty or \"census_loose\" for best possible match based on census data. Optional.\n     * @param {string} LicenseKey - Your license key to use the service.\n     * @param {boolean} isLive - Value to determine whether to use the live or trial servers.\n     * @param {number} timeoutSeconds - Timeout, in seconds, for the call to the service.\n     * @returns {AINResponse} - A AINResponse object with address insight details or an error.\n     *\/\n    invoke(BusinessName, Address1, Address2, City, State, Zip, TestType, LicenseKey, isLive = true, timeoutSeconds = 15) {\n        return (async () => await this.invokeAsync(\n            BusinessName, Address1, Address2, City, State, Zip, TestType, LicenseKey, isLive, timeoutSeconds\n        ))();\n    }\n};\n\nexport { GetAddressInsightClient, AINResponse };\n\n\n\/**\n * Error object for API responses.\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 `Error: Type = ${this.Type}, TypeCode = ${this.TypeCode}, Desc = ${this.Desc}, DescCode = ${this.DescCode}`;\n    }\n}\n\n\/**\n * Response from GetAddressInsight API, containing address validation, geocoding, and demographic information.\n *\/\nexport class AINResponse {\n    constructor(data = {}) {\n        this.Status = data.Status;\n        this.StatusScore = data.StatusScore;\n        this.AddressStatus = data.AddressStatus;\n        this.DPV = data.DPV;\n        this.DPVDesc = data.DPVDesc;\n        this.Address = data.Address;\n        this.AddressExtra = data.AddressExtra;\n        this.City = data.City;\n        this.State = data.State;\n        this.Zip = data.Zip;\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.FragmentUnitNumber = data.FragmentUnitNumber;\n        this.Fragment = data.Fragment;\n        this.FragmentPMBPrefix = data.FragmentPMBPrefix;\n        this.FragmentPMBNumber = data.FragmentPMBNumber;\n        this.Corrections = data.Corrections;\n        this.CorrectionsDesc = data.CorrectionsDesc;\n        this.AddressNotes = data.AddressNotes;\n        this.AddressNotesCodes = data.AddressNotesCodes;\n        this.GeocodeStatus = data.GeocodeStatus;\n        this.LocationLatitude = data.LocationLatitude;\n        this.LocationLongitude = data.LocationLongitude;\n        this.CensusTract = data.CensusTract;\n        this.CensusBlock = data.CensusBlock;\n        this.PlaceName = data.PlaceName;\n        this.ClassFP = data.ClassFP;\n        this.SLDUST = data.SLDUST;\n        this.SLDLST = data.SLDLST;\n        this.CountyFIPS = data.CountyFIPS;\n        this.StateFIPS = data.StateFIPS;\n        this.GeocodeNotes = data.GeocodeNotes;\n        this.GeocodeNotesCodes = data.GeocodeNotesCodes;\n        this.ZipStatus = data.ZipStatus;\n        this.ZipLatitude = data.ZipLatitude;\n        this.ZipLongitude = data.ZipLongitude;\n        this.CityType = data.CityType;\n        this.CityAliasName = data.CityAliasName;\n        this.AreaCode = data.AreaCode;\n        this.TimeZone = data.TimeZone;\n        this.DaylightSaving = data.DaylightSaving;\n        this.MSA = data.MSA;\n        this.CBSA = data.CBSA;\n        this.CBSA_Div = data.CBSA_Div;\n        this.PMSA = data.PMSA;\n        this.DMA = data.DMA;\n        this.ZipHouseholdValue = data.ZipHouseholdValue;\n        this.ZipPersonsPerHousehold = data.ZipPersonsPerHousehold;\n        this.ZipHouseholdIncome = data.ZipHouseholdIncome;\n        this.CountyHouseholdIncome = data.CountyHouseholdIncome;\n        this.StateHouseholdIncome = data.StateHouseholdIncome;\n        this.ZipNotes = data.ZipNotes;\n        this.ZipNotesCodes = data.ZipNotesCodes;\n        this.Debug = data.Debug || [];\n        this.Error = data.Error ? new Error(data.Error) : null;\n    }\n\n    toString() {\n        const debugString = this.Debug.length ? this.Debug.join(', ') : 'null';\n        return `AINResponse: Status = ${this.Status}, StatusScore = ${this.StatusScore}, AddressStatus = ${this.AddressStatus}, ` +\n            `DPV = ${this.DPV}, DPVDesc = ${this.DPVDesc}, Address = ${this.Address}, AddressExtra = ${this.AddressExtra}, ` +\n            `City = ${this.City}, State = ${this.State}, Zip = ${this.Zip}, BarcodeDigits = ${this.BarcodeDigits}, ` +\n            `CarrierRoute = ${this.CarrierRoute}, CongressCode = ${this.CongressCode}, CountyCode = ${this.CountyCode}, ` +\n            `CountyName = ${this.CountyName}, FragmentHouse = ${this.FragmentHouse}, FragmentPreDir = ${this.FragmentPreDir}, ` +\n            `FragmentStreet = ${this.FragmentStreet}, FragmentSuffix = ${this.FragmentSuffix}, FragmentPostDir = ${this.FragmentPostDir}, ` +\n            `FragmentUnit = ${this.FragmentUnit}, FragmentUnitNumber = ${this.FragmentUnitNumber}, Fragment = ${this.Fragment}, ` +\n            `FragmentPMBPrefix = ${this.FragmentPMBPrefix}, FragmentPMBNumber = ${this.FragmentPMBNumber}, ` +\n            `Corrections = ${this.Corrections}, CorrectionsDesc = ${this.CorrectionsDesc}, AddressNotes = ${this.AddressNotes}, ` +\n            `AddressNotesCodes = ${this.AddressNotesCodes}, GeocodeStatus = ${this.GeocodeStatus}, LocationLatitude = ${this.LocationLatitude}, ` +\n            `LocationLongitude = ${this.LocationLongitude}, CensusTract = ${this.CensusTract}, CensusBlock = ${this.CensusBlock}, ` +\n            `PlaceName = ${this.PlaceName}, ClassFP = ${this.ClassFP}, SLDUST = ${this.SLDUST}, SLDLST = ${this.SLDLST}, ` +\n            `CountyFIPS = ${this.CountyFIPS}, StateFIPS = ${this.StateFIPS}, GeocodeNotes = ${this.GeocodeNotes}, ` +\n            `GeocodeNotesCodes = ${this.GeocodeNotesCodes}, ZipStatus = ${this.ZipStatus}, ZipLatitude = ${this.ZipLatitude}, ` +\n            `ZipLongitude = ${this.ZipLongitude}, CityType = ${this.CityType}, CityAliasName = ${this.CityAliasName}, ` +\n            `AreaCode = ${this.AreaCode}, TimeZone = ${this.TimeZone}, DaylightSaving = ${this.DaylightSaving}, ` +\n            `MSA = ${this.MSA}, CBSA = ${this.CBSA}, CBSA_Div = ${this.CBSA_Div}, PMSA = ${this.PMSA}, DMA = ${this.DMA}, ` +\n            `ZipHouseholdValue = ${this.ZipHouseholdValue}, ZipPersonsPerHousehold = ${this.ZipPersonsPerHousehold}, ` +\n            `ZipHouseholdIncome = ${this.ZipHouseholdIncome}, CountyHouseholdIncome = ${this.CountyHouseholdIncome}, ` +\n            `StateHouseholdIncome = ${this.StateHouseholdIncome}, ZipNotes = ${this.ZipNotes}, ZipNotesCodes = ${this.ZipNotesCodes}, ` +\n            `Debug = [${debugString}], Error = ${this.Error ? this.Error.toString() : 'null'}`;\n    }\n}\n\nexport default AINResponse;<\/pre>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":2492,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2497","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>AIUS - REST<\/title>\n<meta name=\"description\" content=\"C#PythonNodeJS Address Insight C# Rest Code Snippet \ufeff\ufeffusing System.Web; namespace address_insight_us_dot_net.REST { \/\/\/ &lt;summary&gt; \/\/\/ Provides\" \/>\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-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AIUS - REST\" \/>\n<meta property=\"og:description\" content=\"C#PythonNodeJS Address Insight C# Rest Code Snippet \ufeff\ufeffusing System.Web; namespace address_insight_us_dot_net.REST { \/\/\/ &lt;summary&gt; \/\/\/ Provides\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-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-09-27T23:10:00+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-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/\",\"name\":\"AIUS - REST\",\"isPartOf\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#website\"},\"datePublished\":\"2022-11-09T07:20:00+00:00\",\"dateModified\":\"2025-09-27T23:10:00+00:00\",\"description\":\"C#PythonNodeJS Address Insight C# Rest Code Snippet \ufeff\ufeffusing System.Web; namespace address_insight_us_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides\",\"breadcrumb\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DOTS Address Insight &#8211; US\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"AIUS &#8211; Code Snippets and Sample Code\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"AIUS &#8211; REST\"}]},{\"@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":"AIUS - REST","description":"C#PythonNodeJS Address Insight C# Rest Code Snippet \ufeff\ufeffusing System.Web; namespace address_insight_us_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides","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-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/","og_locale":"en_US","og_type":"article","og_title":"AIUS - REST","og_description":"C#PythonNodeJS Address Insight C# Rest Code Snippet \ufeff\ufeffusing System.Web; namespace address_insight_us_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides","og_url":"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/","og_site_name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","article_modified_time":"2025-09-27T23:10:00+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-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/","url":"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/","name":"AIUS - REST","isPartOf":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#website"},"datePublished":"2022-11-09T07:20:00+00:00","dateModified":"2025-09-27T23:10:00+00:00","description":"C#PythonNodeJS Address Insight C# Rest Code Snippet \ufeff\ufeffusing System.Web; namespace address_insight_us_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides","breadcrumb":{"@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/aius-rest\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.serviceobjects.com\/docs\/"},{"@type":"ListItem","position":2,"name":"DOTS Address Insight &#8211; US","item":"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/"},{"@type":"ListItem","position":3,"name":"AIUS &#8211; Code Snippets and Sample Code","item":"https:\/\/www.serviceobjects.com\/docs\/dots-address-insight-us\/aius-code-snippets-and-sample-code\/"},{"@type":"ListItem","position":4,"name":"AIUS &#8211; REST"}]},{"@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\/2497","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/comments?post=2497"}],"version-history":[{"count":11,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/2497\/revisions"}],"predecessor-version":[{"id":12366,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/2497\/revisions\/12366"}],"up":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/2492"}],"wp:attachment":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/media?parent=2497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}