{"id":2532,"date":"2022-11-09T07:45:16","date_gmt":"2022-11-09T07:45:16","guid":{"rendered":"https:\/\/serviceobjects.wpaladdin.com\/?post_type=serviceobjects&#038;p=2532"},"modified":"2025-10-08T10:42:09","modified_gmt":"2025-10-08T17:42:09","slug":"avca2-rest","status":"publish","type":"page","link":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/","title":{"rendered":"AVCA2 &#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><strong>Address Validation Canada 2 C# Rest Code Snippet<\/strong><\/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=\"\">\ufeffnamespace address_validation_canada_2_dot_net.REST\n{\n    \/\/\/ &lt;summary>\n    \/\/\/ Provides functionality to call the ServiceObjects AVCA2 REST API's ValidateCanadianAddressV2 endpoint,\n    \/\/\/ retrieving validated Canadian address information (e.g., corrected address, municipality, province, postal code)\n    \/\/\/ for a given input with fallback to a backup endpoint for reliability in live mode.\n    \/\/\/ &lt;\/summary>\n    public static class ValidateCanadianAddressV2Client\n    {\n        \/\/ Base URL constants: production, backup, and trial\n        private const string LiveBaseUrl = \"https:\/\/sws.serviceobjects.com\/AVCA2\/api.svc\/\";\n        private const string BackupBaseUrl = \"https:\/\/swsbackup.serviceobjects.com\/AVCA2\/api.svc\/\";\n        private const string TrialBaseUrl = \"https:\/\/trial.serviceobjects.com\/AVCA2\/api.svc\/\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Synchronously calls the ValidateCanadianAddressV2 REST endpoint to retrieve validated address 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 address, municipality, province, postal code, language, and license key.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"AVCA2Response\"\/> containing validated address data or an error.&lt;\/returns>\n        public static AVCA2Response Invoke(ValidateCanadianAddressV2Input 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            AVCA2Response response = Helper.HttpGet&lt;AVCA2Response>(url, input.TimeoutSeconds);\n\n            \/\/ Fallback on error in live mode\n            if (input.IsLive &amp;&amp; !ValidResponse(response))\n            {\n                string fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                AVCA2Response fallbackResponse = Helper.HttpGet&lt;AVCA2Response>(fallbackUrl, input.TimeoutSeconds);\n                return fallbackResponse;\n            }\n\n            return response;\n        }\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Asynchronously calls the ValidateCanadianAddressV2 REST endpoint to retrieve validated address 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 address, municipality, province, postal code, language, and license key.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"AVCA2Response\"\/> containing validated address data or an error.&lt;\/returns>\n        public static async Task&lt;AVCA2Response> InvokeAsync(ValidateCanadianAddressV2Input 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            AVCA2Response response = await Helper.HttpGetAsync&lt;AVCA2Response>(url, input.TimeoutSeconds).ConfigureAwait(false);\n\n            \/\/ Fallback on error in live mode\n            if (input.IsLive &amp;&amp; !ValidResponse(response))\n            {\n                string fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                AVCA2Response fallbackResponse = await Helper.HttpGetAsync&lt;AVCA2Response>(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        public static string BuildUrl(ValidateCanadianAddressV2Input input, string baseUrl)\n        {\n            \/\/ Construct query string with URL-encoded parameters\n            string qs = $\"ValidateCanadianAddressV2?\" +\n                        $\"Address={Helper.UrlEncode(input.Address)}\" +\n                        $\"&amp;Address2={Helper.UrlEncode(input.Address2)}\" +\n                        $\"&amp;Municipality={Helper.UrlEncode(input.Municipality)}\" +\n                        $\"&amp;Province={Helper.UrlEncode(input.Province)}\" +\n                        $\"&amp;PostalCode={Helper.UrlEncode(input.PostalCode)}\" +\n                        $\"&amp;Language={Helper.UrlEncode(input.Language)}\" +\n                        $\"&amp;LicenseKey={Helper.UrlEncode(input.LicenseKey)}\" +\n                        $\"&amp;Format=JSON\";\n            return baseUrl + qs;\n        }\n\n        private static bool ValidResponse(AVCA2Response response) => response?.Error == null || response.Error.TypeCode != \"3\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Input parameters for the ValidateCanadianAddressV2 API call. Represents a Canadian address to validate.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"Address\">Address line of the address to validate (e.g., \"50 Coach Hill Dr\").&lt;\/param>\n        \/\/\/ &lt;param name=\"Address2\">Secondary address line. Optional.&lt;\/param>\n        \/\/\/ &lt;param name=\"Municipality\">The municipality of the address (e.g., \"Kitchener\"). Optional if postal code is provided.&lt;\/param>\n        \/\/\/ &lt;param name=\"Province\">The province of the address (e.g., \"Ont\"). Optional if postal code is provided.&lt;\/param>\n        \/\/\/ &lt;param name=\"PostalCode\">The postal code of the address (e.g., \"N2E 1P4\"). Optional if municipality and province are provided.&lt;\/param>\n        \/\/\/ &lt;param name=\"Language\">The language for the response (e.g., \"EN\", \"FR\", \"EN-Proper\"). 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 ValidateCanadianAddressV2Input(\n            string Address = \"\",\n            string Address2 = \"\",\n            string Municipality = \"\",\n            string Province = \"\",\n            string PostalCode = \"\",\n            string Language = \"\",\n            string LicenseKey = \"\",\n            bool IsLive = true,\n            int TimeoutSeconds = 15\n        );\n    }\n}\n\n\n\ufeffusing System.Text.Json;\nusing System.Web;\n\nnamespace address_validation_canada_2_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><strong><strong>Address Validation Canada 2 Python Code Snippet<\/strong><\/strong><\/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 avca2_response import AVCA2Response, CanadianAddressInfoV2, Error\nimport requests\n\n# Endpoint URLs for ServiceObjects AVCA2 (Address Validation - Canada) API\nprimary_url = \"https:\/\/sws.serviceobjects.com\/AVCA2\/api.svc\/ValidateCanadianAddressV2?\"\nbackup_url = \"https:\/\/swsbackup.serviceobjects.com\/AVCA2\/api.svc\/ValidateCanadianAddressV2?\"\ntrial_url = \"https:\/\/trial.serviceobjects.com\/AVCA2\/api.svc\/ValidateCanadianAddressV2?\"\n\ndef validate_canadian_address_v2(\n    address: str,\n    address2: str,\n    municipality: str,\n    province: str,\n    postal_code: str,\n    language: str,\n    license_key: str,\n    is_live: bool,\n    timeout_seconds: int = 15\n) -> AVCA2Response:\n    \"\"\"\n    Call ServiceObjects AVCA2 API's ValidateCanadianAddressV2 endpoint\n    to retrieve validated Canadian address information for a given address.\n\n    Parameters:\n        address: Address line of the address to validate (e.g., \"50 Coach Hill Dr\").\n        address2: Secondary address line (e.g., \"Apt 4B\"). Optional.\n        municipality: The municipality of the address (e.g., \"Kitchener\"). Optional if postal code is provided.\n        province: The province of the address (e.g., \"Ont\"). Optional if postal code is provided.\n        postal_code: The postal code of the address (e.g., \"N2E 1P4\"). Optional if municipality and province are provided.\n        language: The language for the response (e.g., \"EN\", \"FR\", \"EN-Proper\", \"FR-Proper\"). Optional.\n        license_key: Your ServiceObjects license key.\n        is_live: Use live or trial servers.\n        timeout_seconds: Timeout for the HTTP request in seconds.\n\n    Returns:\n        AVCA2Response: Parsed JSON response with validated address details 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        \"Address\": address,\n        \"Address2\": address2,\n        \"Municipality\": municipality,\n        \"Province\": province,\n        \"PostalCode\": postal_code,\n        \"Language\": language,\n        \"LicenseKey\": license_key,\n        \"Format\":\"JSON\"\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=timeout_seconds)\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=timeout_seconds)\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\"AVCA2 service error: {data['Error']}\")\n            else:\n                # Trial mode error is terminal\n                raise RuntimeError(f\"AVCA2 trial error: {data['Error']}\")\n\n        # Convert JSON response to AVCA2Response for structured access\n        error = Error(**data.get(\"Error\", {})) if data.get(\"Error\") else None\n\n        return AVCA2Response(\n            CanadianAddressInfoV2=CanadianAddressInfoV2(\n                Address=data.get(\"CanadianAddressInfoV2\", {}).get(\"Address\"),\n                Address2=data.get(\"CanadianAddressInfoV2\", {}).get(\"Address2\"),\n                Municipality=data.get(\"CanadianAddressInfoV2\", {}).get(\"Municipality\"),\n                Province=data.get(\"CanadianAddressInfoV2\", {}).get(\"Province\"),\n                PostalCode=data.get(\"CanadianAddressInfoV2\", {}).get(\"PostalCode\"),\n                TimeZone=data.get(\"CanadianAddressInfoV2\", {}).get(\"TimeZone\"),\n                AddressNumberFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"AddressNumberFragment\"),\n                StreetNameFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"StreetNameFragment\"),\n                StreetTypeFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"StreetTypeFragment\"),\n                DirectionalCodeFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"DirectionalCodeFragment\"),\n                UnitTypeFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"UnitTypeFragment\"),\n                UnitNumberFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"UnitNumberFragment\"),\n                IsPOBox=data.get(\"CanadianAddressInfoV2\", {}).get(\"IsPOBox\"),\n                BoxNumberFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"BoxNumberFragment\"),\n                StationInfo=data.get(\"CanadianAddressInfoV2\", {}).get(\"StationInfo\"),\n                DeliveryMode=data.get(\"CanadianAddressInfoV2\", {}).get(\"DeliveryMode\"),\n                DeliveryInstallation=data.get(\"CanadianAddressInfoV2\", {}).get(\"DeliveryInstallation\"),\n                Corrections=data.get(\"CanadianAddressInfoV2\", {}).get(\"Corrections\"),\n                CorrectionsDescriptions=data.get(\"CanadianAddressInfoV2\", {}).get(\"CorrectionsDescriptions\")\n            ) if data.get(\"CanadianAddressInfoV2\") else None,\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=timeout_seconds)\n                response.raise_for_status()\n                data = response.json()\n                if \"Error\" in data:\n                    raise RuntimeError(f\"AVCA2 backup error: {data['Error']}\") from req_exc\n\n                error = Error(**data.get(\"Error\", {})) if data.get(\"Error\") else None\n\n                return AVCA2Response(\n                    CanadianAddressInfoV2=CanadianAddressInfoV2(\n                        Address=data.get(\"CanadianAddressInfoV2\", {}).get(\"Address\"),\n                        Address2=data.get(\"CanadianAddressInfoV2\", {}).get(\"Address2\"),\n                        Municipality=data.get(\"CanadianAddressInfoV2\", {}).get(\"Municipality\"),\n                        Province=data.get(\"CanadianAddressInfoV2\", {}).get(\"Province\"),\n                        PostalCode=data.get(\"CanadianAddressInfoV2\", {}).get(\"PostalCode\"),\n                        TimeZone=data.get(\"CanadianAddressInfoV2\", {}).get(\"TimeZone\"),\n                        AddressNumberFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"AddressNumberFragment\"),\n                        StreetNameFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"StreetNameFragment\"),\n                        StreetTypeFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"StreetTypeFragment\"),\n                        DirectionalCodeFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"DirectionalCodeFragment\"),\n                        UnitTypeFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"UnitTypeFragment\"),\n                        UnitNumberFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"UnitNumberFragment\"),\n                        IsPOBox=data.get(\"CanadianAddressInfoV2\", {}).get(\"IsPOBox\"),\n                        BoxNumberFragment=data.get(\"CanadianAddressInfoV2\", {}).get(\"BoxNumberFragment\"),\n                        StationInfo=data.get(\"CanadianAddressInfoV2\", {}).get(\"StationInfo\"),\n                        DeliveryMode=data.get(\"CanadianAddressInfoV2\", {}).get(\"DeliveryMode\"),\n                        DeliveryInstallation=data.get(\"CanadianAddressInfoV2\", {}).get(\"DeliveryInstallation\"),\n                        Corrections=data.get(\"CanadianAddressInfoV2\", {}).get(\"Corrections\"),\n                        CorrectionsDescriptions=data.get(\"CanadianAddressInfoV2\", {}).get(\"CorrectionsDescriptions\")\n                    ) if data.get(\"CanadianAddressInfoV2\") else None,\n                    Error=error,\n                )\n            except Exception as backup_exc:\n                raise RuntimeError(\"AVCA2 service unreachable on both endpoints\") from backup_exc\n        else:\n            raise RuntimeError(f\"AVCA2 trial error: {str(req_exc)}\") from req_exc\n\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}, \"\n                f\"DescCode={self.DescCode}\")\n\n@dataclass\nclass CanadianAddressInfo:\n    Address: Optional[str] = None\n    Address2: Optional[str] = None\n    Municipality: Optional[str] = None\n    Province: Optional[str] = None\n    PostalCode: Optional[str] = None\n    TimeZone: Optional[str] = None\n    AddressNumberFragment: Optional[str] = None\n    StreetNameFragment: Optional[str] = None\n    StreetTypeFragment: Optional[str] = None\n    DirectionalCodeFragment: Optional[str] = None\n    UnitTypeFragment: Optional[str] = None\n    UnitNumberFragment: Optional[str] = None\n    IsPOBox: Optional[bool] = None\n    BoxNumberFragment: Optional[str] = None\n    StationInfo: Optional[str] = None\n    DeliveryMode: Optional[str] = None\n    DeliveryInstallation: Optional[str] = None\n\n    def __str__(self) -> str:\n        return (f\"CanadianAddressInfo: Address={self.Address}, Address2={self.Address2}, \"\n                f\"Municipality={self.Municipality}, Province={self.Province}, PostalCode={self.PostalCode}, \"\n                f\"TimeZone={self.TimeZone}, AddressNumberFragment={self.AddressNumberFragment}, \"\n                f\"StreetNameFragment={self.StreetNameFragment}, StreetTypeFragment={self.StreetTypeFragment}, \"\n                f\"DirectionalCodeFragment={self.DirectionalCodeFragment}, UnitTypeFragment={self.UnitTypeFragment}, \"\n                f\"UnitNumberFragment={self.UnitNumberFragment}, IsPOBox={self.IsPOBox}, \"\n                f\"BoxNumberFragment={self.BoxNumberFragment}, StationInfo={self.StationInfo}, \"\n                f\"DeliveryMode={self.DeliveryMode}, DeliveryInstallation={self.DeliveryInstallation}\")\n\n@dataclass\nclass CanadianAddressInfoV2:\n    Address: Optional[str] = None\n    Address2: Optional[str] = None\n    Municipality: Optional[str] = None\n    Province: Optional[str] = None\n    PostalCode: Optional[str] = None\n    TimeZone: Optional[str] = None\n    AddressNumberFragment: Optional[str] = None\n    StreetNameFragment: Optional[str] = None\n    StreetTypeFragment: Optional[str] = None\n    DirectionalCodeFragment: Optional[str] = None\n    UnitTypeFragment: Optional[str] = None\n    UnitNumberFragment: Optional[str] = None\n    IsPOBox: Optional[bool] = None\n    BoxNumberFragment: Optional[str] = None\n    StationInfo: Optional[str] = None\n    DeliveryMode: Optional[str] = None\n    DeliveryInstallation: Optional[str] = None\n    Corrections: Optional[str] = None\n    CorrectionsDescriptions: Optional[str] = None\n\n    def __str__(self) -> str:\n        return (f\"CanadianAddressInfoV2: Address={self.Address}, Address2={self.Address2}, \"\n                f\"Municipality={self.Municipality}, Province={self.Province}, PostalCode={self.PostalCode}, \"\n                f\"TimeZone={self.TimeZone}, AddressNumberFragment={self.AddressNumberFragment}, \"\n                f\"StreetNameFragment={self.StreetNameFragment}, StreetTypeFragment={self.StreetTypeFragment}, \"\n                f\"DirectionalCodeFragment={self.DirectionalCodeFragment}, UnitTypeFragment={self.UnitTypeFragment}, \"\n                f\"UnitNumberFragment={self.UnitNumberFragment}, IsPOBox={self.IsPOBox}, \"\n                f\"BoxNumberFragment={self.BoxNumberFragment}, StationInfo={self.StationInfo}, \"\n                f\"DeliveryMode={self.DeliveryMode}, DeliveryInstallation={self.DeliveryInstallation}, \"\n                f\"Corrections={self.Corrections}, CorrectionsDescriptions={self.CorrectionsDescriptions}\")\n\n@dataclass\nclass AVCA2Response:\n    CanadianAddressInfoV2: Optional['CanadianAddressInfoV2'] = None\n    CanadianAddressInfo: Optional['CanadianAddressInfo'] = None\n    Error: Optional['Error'] = None\n\n    def __str__(self) -> str:\n        address_info_v2 = str(self.CanadianAddressInfoV2) if self.CanadianAddressInfoV2 else 'None'\n        address_info = str(self.CanadianAddressInfo) if self.CanadianAddressInfo else 'None'\n        error = str(self.Error) if self.Error else 'None'\n        return (f\"AVCA2Response: CanadianAddressInfoV2={address_info_v2}, \"\n                f\"CanadianAddressInfo={address_info}, 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><strong>Address Validation Canada 2 REST NodeJS Code Snippet<\/strong><\/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 { AVCA2Response } from '.\/avca2_response.js';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the live ServiceObjects AVCA2 (Address Validation - Canada) API service.\n *\/\nconst LiveBaseUrl = 'https:\/\/sws.serviceobjects.com\/AVCA2\/api.svc\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the backup ServiceObjects AVCA2 API service.\n *\/\nconst BackupBaseUrl = 'https:\/\/swsbackup.serviceobjects.com\/AVCA2\/api.svc\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the trial ServiceObjects AVCA2 API service.\n *\/\nconst TrialBaseUrl = 'https:\/\/trial.serviceobjects.com\/AVCA2\/api.svc\/';\n\n\/**\n * @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 * @param {Object} response - The API response object to validate.\n * @returns {boolean} True if the response is valid, false otherwise.\n *\/\nconst isValid = (response) => !response?.Error || response.Error.TypeCode !== '3';\n\n\/**\n * @summary\n * Constructs a full URL for the ValidateCanadianAddressV2 API endpoint by combining the base URL\n * with query parameters derived from the input parameters.\n * @param {Object} params - An object containing all the input parameters.\n * @param {string} baseUrl - The base URL for the API service (live, backup, or trial).\n * @returns {string} The constructed URL with query parameters.\n *\/\nconst buildUrl = (params, baseUrl) =>\n    `${baseUrl}ValidateCanadianAddressV2?${querystring.stringify(params)}`;\n\n\/**\n * @summary\n * Performs an HTTP GET request to the specified URL with a given timeout.\n * @param {string} url - The URL to send the GET request to.\n * @param {number} timeoutSeconds - The timeout duration in seconds for the request.\n * @returns {Promise&lt;AVCA2Response>} A promise that resolves to an AVCA2Response object containing the API response data.\n * @throws {Error} Thrown if the HTTP request fails, with a message detailing the error.\n *\/\nconst httpGet = async (url, timeoutSeconds) => {\n    try {\n        const response = await axios.get(url, { timeout: timeoutSeconds * 1000 });\n        return new AVCA2Response(response.data);\n    } catch (error) {\n        throw new Error(`HTTP request failed: ${error.message}`);\n    }\n};\n\n\/**\n * @summary\n * Provides functionality to call the ServiceObjects AVCA2 API's ValidateCanadianAddressV2 endpoint,\n * retrieving validated Canadian address information with fallback to a backup endpoint for reliability in live mode.\n *\/\nconst ValidateCanadianAddressV2Client = {\n    \/**\n     * @summary\n     * Asynchronously invokes the ValidateCanadianAddressV2 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     * @param {string} Address - Address line of the address to validate (e.g., \"50 Coach Hill Dr\").\n     * @param {string} Address2 - Secondary address line (e.g., \"Apt 4B\"). Optional.\n     * @param {string} Municipality - The municipality of the address (e.g., \"Kitchener\"). Optional if postal code is provided.\n     * @param {string} Province - The province of the address (e.g., \"Ont\"). Optional if postal code is provided.\n     * @param {string} PostalCode - The postal code of the address (e.g., \"N2E 1P4\"). Optional if municipality and province are provided.\n     * @param {string} Language - The language for the response (e.g., \"EN\", \"FR\", \"EN-Proper\", \"FR-Proper\"). 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;AVCA2Response>} A promise that resolves to an AVCA2Response object.\n     *\/\n    async invokeAsync(Address, Address2, Municipality, Province, PostalCode, Language, LicenseKey, isLive = true, timeoutSeconds = 15) {\n        const params = {\n            Address,\n            Address2,\n            Municipality,\n            Province,\n            PostalCode,\n            Language,\n            LicenseKey,\n            Format: 'JSON'\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     * @summary\n     * Synchronously invokes the ValidateCanadianAddressV2 API endpoint by wrapping the async call\n     * and awaiting its result immediately.\n     * @param {string} Address - Address line of the address to validate (e.g., \"50 Coach Hill Dr\").\n     * @param {string} Address2 - Secondary address line (e.g., \"Apt 4B\"). Optional.\n     * @param {string} Municipality - The municipality of the address (e.g., \"Kitchener\"). Optional if postal code is provided.\n     * @param {string} Province - The province of the address (e.g., \"Ont\"). Optional if postal code is provided.\n     * @param {string} PostalCode - The postal code of the address (e.g., \"N2E 1P4\"). Optional if municipality and province are provided.\n     * @param {string} Language - The language for the response (e.g., \"EN\", \"FR\", \"EN-Proper\", \"FR-Proper\"). 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 {AVCA2Response} An AVCA2Response object with validated address details or an error.\n     *\/\n    invoke(Address, Address2, Municipality, Province, PostalCode, Language, LicenseKey, isLive = true, timeoutSeconds = 15) {\n        return (async () => await this.invokeAsync(\n            Address, Address2, Municipality, Province, PostalCode, Language, LicenseKey, isLive, timeoutSeconds\n        ))();\n    }\n};\n\nexport { ValidateCanadianAddressV2Client, AVCA2Response };\n\n\nexport class AVCA2Response {\n    constructor(data = {}) {\n        this.CanadianAddressInfoV2 = data.CanadianAddressInfoV2 ? new CanadianAddressInfoV2(data.CanadianAddressInfoV2) : null;\n        this.CanadianAddressInfo = data.CanadianAddressInfo ? new CanadianAddressInfo(data.CanadianAddressInfo) : null;\n        this.Error = data.Error ? new Error(data.Error) : null;\n        this.Debug = data.Debug || [];\n    }\n\n    toString() {\n        const debugString = this.Debug.length ? this.Debug.join(', ') : 'null';\n        return `AVCA2Response: CanadianAddressInfoV2 = ${this.CanadianAddressInfoV2 ? this.CanadianAddressInfoV2.toString() : 'null'}, CanadianAddressInfo = ${this.CanadianAddressInfo ? this.CanadianAddressInfo.toString() : 'null'}, Error = ${this.Error ? this.Error.toString() : 'null'}, Debug = [${debugString}]`;\n    }\n}\n\nexport class CanadianAddressInfoV2 {\n    constructor(data = {}) {\n        this.Address = data.Address;\n        this.Address2 = data.Address2;\n        this.Municipality = data.Municipality;\n        this.Province = data.Province;\n        this.PostalCode = data.PostalCode;\n        this.TimeZone = data.TimeZone;\n        this.AddressNumberFragment = data.AddressNumberFragment;\n        this.StreetNameFragment = data.StreetNameFragment;\n        this.StreetTypeFragment = data.StreetTypeFragment;\n        this.DirectionalCodeFragment = data.DirectionalCodeFragment;\n        this.UnitTypeFragment = data.UnitTypeFragment;\n        this.UnitNumberFragment = data.UnitNumberFragment;\n        this.IsPOBox = data.IsPOBox;\n        this.BoxNumberFragment = data.BoxNumberFragment;\n        this.StationInfo = data.StationInfo;\n        this.DeliveryMode = data.DeliveryMode;\n        this.DeliveryInstallation = data.DeliveryInstallation;\n        this.Corrections = data.Corrections;\n        this.CorrectionsDescriptions = data.CorrectionsDescriptions;\n    }\n\n    toString() {\n        return `CanadianAddressInfoV2: Address = ${this.Address}, Address2 = ${this.Address2}, Municipality = ${this.Municipality}, Province = ${this.Province}, PostalCode = ${this.PostalCode}, TimeZone = ${this.TimeZone}, AddressNumberFragment = ${this.AddressNumberFragment}, StreetNameFragment = ${this.StreetNameFragment}, StreetTypeFragment = ${this.StreetTypeFragment}, DirectionalCodeFragment = ${this.DirectionalCodeFragment}, UnitTypeFragment = ${this.UnitTypeFragment}, UnitNumberFragment = ${this.UnitNumberFragment}, IsPOBox = ${this.IsPOBox}, BoxNumberFragment = ${this.BoxNumberFragment}, StationInfo = ${this.StationInfo}, DeliveryMode = ${this.DeliveryMode}, DeliveryInstallation = ${this.DeliveryInstallation}, Corrections = ${this.Corrections}, CorrectionsDescriptions = ${this.CorrectionsDescriptions}`;\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 `Error: Type = ${this.Type}, TypeCode = ${this.TypeCode}, Desc = ${this.Desc}, DescCode = ${this.DescCode}`;\n    }\n}\nexport class CanadianAddressInfo {\n    constructor(data = {}) {\n        this.Address = data.Address;\n        this.Address2 = data.Address2;\n        this.Municipality = data.Municipality;\n        this.Province = data.Province;\n        this.PostalCode = data.PostalCode;\n        this.TimeZone = data.TimeZone;\n        this.AddressNumberFragment = data.AddressNumberFragment;\n        this.StreetNameFragment = data.StreetNameFragment;\n        this.StreetTypeFragment = data.StreetTypeFragment;\n        this.DirectionalCodeFragment = data.DirectionalCodeFragment;\n        this.UnitTypeFragment = data.UnitTypeFragment;\n        this.UnitNumberFragment = data.UnitNumberFragment;\n        this.IsPOBox = data.IsPOBox;\n        this.BoxNumberFragment = data.BoxNumberFragment;\n        this.StationInfo = data.StationInfo;\n        this.DeliveryMode = data.DeliveryMode;\n        this.DeliveryInstallation = data.DeliveryInstallation;\n    }\n\n    toString() {\n        return `CanadianAddressInfo: Address = ${this.Address}, Address2 = ${this.Address2}, Municipality = ${this.Municipality}, Province = ${this.Province}, PostalCode = ${this.PostalCode}, TimeZone = ${this.TimeZone}, AddressNumberFragment = ${this.AddressNumberFragment}, StreetNameFragment = ${this.StreetNameFragment}, StreetTypeFragment = ${this.StreetTypeFragment}, DirectionalCodeFragment = ${this.DirectionalCodeFragment}, UnitTypeFragment = ${this.UnitTypeFragment}, UnitNumberFragment = ${this.UnitNumberFragment}, IsPOBox = ${this.IsPOBox}, BoxNumberFragment = ${this.BoxNumberFragment}, StationInfo = ${this.StationInfo}, DeliveryMode = ${this.DeliveryMode}, DeliveryInstallation = ${this.DeliveryInstallation}`;\n    }\n}\n\nexport default AVCA2Response;<\/pre>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":2495,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2532","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>AVCA2 - REST<\/title>\n<meta name=\"description\" content=\"C#PythonNodeJS Address Validation Canada 2 C# Rest Code Snippet \ufeffnamespace address_validation_canada_2_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-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AVCA2 - REST\" \/>\n<meta property=\"og:description\" content=\"C#PythonNodeJS Address Validation Canada 2 C# Rest Code Snippet \ufeffnamespace address_validation_canada_2_dot_net.REST { \/\/\/ &lt;summary&gt; \/\/\/ Provides\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-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-08T17:42:09+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-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/\",\"name\":\"AVCA2 - REST\",\"isPartOf\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#website\"},\"datePublished\":\"2022-11-09T07:45:16+00:00\",\"dateModified\":\"2025-10-08T17:42:09+00:00\",\"description\":\"C#PythonNodeJS Address Validation Canada 2 C# Rest Code Snippet \ufeffnamespace address_validation_canada_2_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides\",\"breadcrumb\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DOTS Address Validation &#8211; Canada 2\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"AVCA2 &#8211; Code Snippets and Sample Code\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"AVCA2 &#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":"AVCA2 - REST","description":"C#PythonNodeJS Address Validation Canada 2 C# Rest Code Snippet \ufeffnamespace address_validation_canada_2_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-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/","og_locale":"en_US","og_type":"article","og_title":"AVCA2 - REST","og_description":"C#PythonNodeJS Address Validation Canada 2 C# Rest Code Snippet \ufeffnamespace address_validation_canada_2_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides","og_url":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/","og_site_name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","article_modified_time":"2025-10-08T17:42:09+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-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/","url":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/","name":"AVCA2 - REST","isPartOf":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#website"},"datePublished":"2022-11-09T07:45:16+00:00","dateModified":"2025-10-08T17:42:09+00:00","description":"C#PythonNodeJS Address Validation Canada 2 C# Rest Code Snippet \ufeffnamespace address_validation_canada_2_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides","breadcrumb":{"@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/avca2-rest\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.serviceobjects.com\/docs\/"},{"@type":"ListItem","position":2,"name":"DOTS Address Validation &#8211; Canada 2","item":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/"},{"@type":"ListItem","position":3,"name":"AVCA2 &#8211; Code Snippets and Sample Code","item":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-canada-2\/avca2-code-snippets-and-sample-code\/"},{"@type":"ListItem","position":4,"name":"AVCA2 &#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\/2532","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=2532"}],"version-history":[{"count":9,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/2532\/revisions"}],"predecessor-version":[{"id":12377,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/2532\/revisions\/12377"}],"up":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/2495"}],"wp:attachment":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/media?parent=2532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}