{"id":10101,"date":"2024-08-30T12:02:31","date_gmt":"2024-08-30T19:02:31","guid":{"rendered":"https:\/\/www.serviceobjects.com\/docs\/?page_id=10101"},"modified":"2025-09-27T15:44:34","modified_gmt":"2025-09-27T22:44:34","slug":"av4-rest","status":"publish","type":"page","link":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/","title":{"rendered":"AV4 \u2013 REST\u00a0"},"content":{"rendered":"\n<div class=\"wp-block-create-block-tabs\"><ul class=\"tab-labels\" role=\"tablist\" aria-label=\"tabbed content\"><li class=\"tab-label active\" role=\"tab\" aria-selected=\"true\" aria-controls=\"C#\" tabindex=\"0\">C#<\/li><li class=\"tab-label\" role=\"tab\" aria-selected=\"false\" aria-controls=\"Python\" tabindex=\"0\">Python<\/li><li class=\"tab-label\" role=\"tab\" aria-selected=\"false\" aria-controls=\"NodeJS\" tabindex=\"0\">NodeJS<\/li><\/ul><div class=\"tab-content\">\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong>Address Validation US 4 C# Rest Code Snippet<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\ufeffusing System;\nusing System.Text.Json;\nusing System.Threading.Tasks;\nusing System.Web;\n\nnamespace address_validation_us_4_dot_net.REST\n{\n    \/\/\/ &lt;summary>\n    \/\/\/ Provides functionality to call the ServiceObjects AV4 REST API's ValidateAddress endpoint.\n    \/\/\/ Retrieves parsed and validated address elements including Delivery Point Validation (DPV),\n    \/\/\/ Residential Delivery Indicator (RDI), and Suite data with fallback to a backup endpoint for reliability in live mode.\n    \/\/\/ &lt;\/summary>\n    public class ValidateAddressClient\n    {\n        private const string LiveBaseUrl = \"https:\/\/strial.serviceobjects.com\/AV4\/\";\n        private const string BackupBaseUrl = \"https:\/\/strialbackup.serviceobjects.com\/AV4\/\";\n        private const string TrialBaseUrl = \"https:\/\/trial.serviceobjects.com\/AV4\/\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Synchronously calls the ValidateAddress REST endpoint to retrieve validated address information.\n        \/\/\/ Validates input parameters and returns an AV4Response with an Error object if validation fails.\n        \/\/\/ Attempts the primary endpoint first, falling back to the backup if the response is invalid (Error.Status == \"500\") in live mode.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"input\">The input parameters including address components, mode, and authentication details.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"AV4Response\"\/> containing validated address details or an error if validation fails.&lt;\/returns>\n        public static AV4ResponseWrapper Invoke(ValidateAddressInput input)\n        {\n\n            \/\/ Build URL with query string parameters to avoid issues with missing\/optional fields\n            string url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            string jsonResponse = Helper.HttpGet(url, input.TimeoutSeconds);\n            bool IsValid = true;\n            AV4ResponseWrapper response = new();\n            var options = new JsonSerializerOptions\n            {\n                PropertyNameCaseInsensitive = true\n            };\n            if (jsonResponse.Replace(\" \", \"\").Contains(\"\\\"status\\\":4\"))\n            {\n                response.ProblemDetails = JsonSerializer.Deserialize&lt;ProblemDetails>(jsonResponse, options);\n            }\n            else if (jsonResponse.Replace(\" \", \"\").Contains(\"\\\"status\\\":5\"))\n            {\n                IsValid = false;\n            }\n            else\n            {\n                response.ValidateAddressResponse = JsonSerializer.Deserialize&lt;ValidateAddressResponse>(jsonResponse, options);\n            }\n            \/\/ Fallback on error in live mode \n            if (input.IsLive &amp;&amp; !IsValid)\n            {\n                string fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                string fallbackJsonResponse = Helper.HttpGet(fallbackUrl, input.TimeoutSeconds);\n                response = new();\n                if (fallbackJsonResponse.Replace(\" \", \"\").Contains(\"\\\"status\\\":4\") || fallbackJsonResponse.Replace(\" \", \"\").Contains(\"\\\"status\\\":5\"))\n                {\n                    response.ProblemDetails = JsonSerializer.Deserialize&lt;ProblemDetails>(jsonResponse, options);\n                }\n                else\n                {\n                    response.ValidateAddressResponse = JsonSerializer.Deserialize&lt;ValidateAddressResponse>(jsonResponse, options);\n                }\n                return response;\n            }\n            return response;\n        }\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Asynchronously calls the ValidateAddress REST endpoint to retrieve validated address information.\n        \/\/\/ Validates input parameters and returns an AV4Response with an Error object if validation fails.\n        \/\/\/ Attempts the primary endpoint first, falling back to the backup if the response is invalid (Error.Status == \"500\") in live mode.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"input\">The input parameters including address components, mode, and authentication details.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"AV4Response\"\/> containing validated address details or an error if validation fails.&lt;\/returns>\n        public static async Task&lt;AV4ResponseWrapper> InvokeAsync(ValidateAddressInput input)\n        {\n\n            \/\/ Build URL with query string parameters to avoid issues with missing\/optional fields\n            string url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            string jsonResponse = await Helper.HttpGetAsync(url, input.TimeoutSeconds).ConfigureAwait(false);\n\n            bool IsValid = true;\n            AV4ResponseWrapper response = new();\n            var options = new JsonSerializerOptions\n            {\n                PropertyNameCaseInsensitive = true\n            };\n            if (jsonResponse.Replace(\" \", \"\").Contains(\"\\\"status\\\":4\"))\n            {\n                response.ProblemDetails = JsonSerializer.Deserialize&lt;ProblemDetails>(jsonResponse, options);\n            }\n            else if (jsonResponse.Replace(\" \", \"\").Contains(\"\\\"status\\\":5\"))\n            {\n                IsValid = false;\n            }\n            else\n            {\n                response.ValidateAddressResponse = JsonSerializer.Deserialize&lt;ValidateAddressResponse>(jsonResponse, options);\n            }\n\n            if (input.IsLive &amp;&amp; !IsValid)\n            {\n                string fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                string fallbackJsonResponse = await Helper.HttpGetAsync(fallbackUrl, input.TimeoutSeconds).ConfigureAwait(false);\n                response = new();\n                if (fallbackJsonResponse.Replace(\" \", \"\").Contains(\"\\\"status\\\":4\") || fallbackJsonResponse.Replace(\" \", \"\").Contains(\"\\\"status\\\":5\"))\n                {\n                    response.ProblemDetails = JsonSerializer.Deserialize&lt;ProblemDetails>(jsonResponse, options);\n                }\n                else\n                {\n                    response.ValidateAddressResponse = JsonSerializer.Deserialize&lt;ValidateAddressResponse>(jsonResponse, options);\n                }\n                return response;\n            }\n\n            return response;\n        }\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Builds the full request URL with URL-encoded query string parameters.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"input\">The input parameters to include in the query string.&lt;\/param>\n        \/\/\/ &lt;param name=\"baseUrl\">The base URL (live, backup, or trial).&lt;\/param>\n        \/\/\/ &lt;returns>The complete URL with query string.&lt;\/returns>\n        public static string BuildUrl(ValidateAddressInput input, string baseUrl)\n        {\n            string qs = $\"ValidateAddress?\" +\n                     $\"Mode={Helper.UrlEncode(input.Mode)}\" +\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;BusinessName={Helper.UrlEncode(input.BusinessName)}\" +\n                     $\"&amp;FirstName={Helper.UrlEncode(input.FirstName)}\" +\n                     $\"&amp;MiddleName={Helper.UrlEncode(input.MiddleName)}\" +\n                     $\"&amp;LastName={Helper.UrlEncode(input.LastName)}\" +\n                     $\"&amp;PhoneNumber={Helper.UrlEncode(input.PhoneNumber)}\" +\n                     $\"&amp;Options={Helper.UrlEncode(input.Options)}\" +\n                     $\"&amp;AuthID={Helper.UrlEncode(input.AuthID)}\";\n            return baseUrl + qs;\n        }\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Input parameters for the ValidateAddress operation, which validates an address against a CASS-approved engine\n        \/\/\/ and supplemental data sources depending on the mode.\n        \/\/\/ - Mode 1 uses standard USPS datasets.\n        \/\/\/ - Mode 2 includes aggregated non-USPS datasets.\n        \/\/\/ - Mode 3 enhances validation with name and phone-assisted nudging using proprietary data.\n        \/\/\/ Returns parsed and validated address elements including Delivery Point Validation (DPV), Residential Delivery Indicator (RDI),\n        \/\/\/ and Suite data. In cases of ambiguity, multiple address matches may be returned.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"Mode\">Required. Values are \"1\", \"2\", or \"3\". Specifies the validation mode.&lt;\/param>\n        \/\/\/ &lt;param name=\"Address1\">Required. The primary address line or single-line address.&lt;\/param>\n        \/\/\/ &lt;param name=\"Address2\">Optional. The secondary address line (e.g., suite or apartment number).&lt;\/param>\n        \/\/\/ &lt;param name=\"City\">The city of the address. Required if ZIP is not provided.&lt;\/param>\n        \/\/\/ &lt;param name=\"State\">The state of the address. Required if ZIP is not provided.&lt;\/param>\n        \/\/\/ &lt;param name=\"ZIP\">The ZIP code of the address. Required if City and State are not provided.&lt;\/param>\n        \/\/\/ &lt;param name=\"BusinessName\">Optional. Company name for business addresses, may append SuiteLink data.&lt;\/param>\n        \/\/\/ &lt;param name=\"FirstName\">Optional. First name of the contact.&lt;\/param>\n        \/\/\/ &lt;param name=\"MiddleName\">Optional. Middle name of the contact.&lt;\/param>\n        \/\/\/ &lt;param name=\"LastName\">Optional. Last name of the contact.&lt;\/param>\n        \/\/\/ &lt;param name=\"PhoneNumber\">Optional. Phone number for the contact, enables features like PhoneLink.&lt;\/param>\n        \/\/\/ &lt;param name=\"Options\">Optional. Reserved for future use.&lt;\/param>\n        \/\/\/ &lt;param name=\"AuthID\">Required. Authentication ID provided by Service Objects.&lt;\/param>\n        \/\/\/ &lt;param name=\"IsLive\">Optional. True for live service, false for trial service. Defaults to true.&lt;\/param>\n        \/\/\/ &lt;param name=\"TimeoutSeconds\">Optional. Timeout for the HTTP request in seconds. Defaults to 15.&lt;\/param>\n        public record ValidateAddressInput(\n            string Mode = \"\",\n            string Address1 = \"\",\n            string Address2 = \"\",\n            string City = \"\",\n            string State = \"\",\n            string ZIP = \"\",\n            string BusinessName = \"\",\n            string FirstName = \"\",\n            string MiddleName = \"\",\n            string LastName = \"\",\n            string PhoneNumber = \"\",\n            string Options = \"\",\n            string AuthID = \"\",\n            bool IsLive = true,\n            int TimeoutSeconds = 15\n        );\n    }\n}\n\n\n\ufeffusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace address_validation_us_4_dot_net.REST\n{\n    public class AV4ResponseWrapper\n    {\n        public ValidateAddressResponse? ValidateAddressResponse;\n        public ProblemDetails? ProblemDetails;\n        public AV4ResponseWrapper() { }\n    }\n}\n\n\n\ufeffusing System.Text.Json;\nusing System.Web;\n\nnamespace address_validation_us_4_dot_net.REST\n{\n    public static class Helper\n    {\n        private static readonly HttpClient _client = new HttpClient();\n\n        public static async Task&lt;string> HttpGetAsync(string url, int timeoutSeconds)\n        {\n           \n            _client.Timeout = TimeSpan.FromSeconds(timeoutSeconds);\n            HttpResponseMessage response = await _client.GetAsync(url).ConfigureAwait(false);\n            string jsonResponse = await response.Content.ReadAsStringAsync().ConfigureAwait(false);\n            return jsonResponse;\n        }\n\n        public static string HttpGet(string url, int timeoutSeconds)\n        {\n            _client.Timeout = TimeSpan.FromSeconds(timeoutSeconds);\n            HttpResponseMessage response = _client.GetAsync(url).GetAwaiter().GetResult();\n            string jsonResponse = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();\n            return jsonResponse;\n        }\n\n        public static string UrlEncode(string value) => HttpUtility.UrlEncode(value ?? string.Empty);\n    }\n}<\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong>Address Validation US 4 Python Code Snippet<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import requests\nimport json\nfrom av4_response import AV4Response, AddressInfo, ParsedInputInfo, ProblemDetails\n\n# Endpoint URLs for Address Validation US 4 ValidateAddress REST API\nprimary_url = 'https:\/\/strial.serviceobjects.com\/AV4\/ValidateAddress?'\nbackup_url = 'https:\/\/strialbackup.serviceobjects.com\/AV4\/ValidateAddress?'\ntrial_url = 'https:\/\/trial.serviceobjects.com\/AV4\/ValidateAddress?'\n\ndef validate_address(\n    mode: str,\n    address1: str,\n    address2: str = \"\",\n    city: str = \"\",\n    state: str = \"\",\n    zip_code: str = \"\",\n    business_name: str = \"\",\n    first_name: str = \"\",\n    middle_name: str = \"\",\n    last_name: str = \"\",\n    phone_number: str = \"\",\n    options: str = \"\",\n    auth_id: str = \"\",\n    is_live: bool = True,\n    timeout_seconds: int = 15\n) -> AV4Response:\n    \"\"\"\n    Calls the Address Validation US 4 ValidateAddress API to retrieve parsed and validated address elements,\n    including Delivery Point Validation (DPV), Residential Delivery Indicator (RDI), and Suite data.\n    Validates input parameters and returns a ProblemDetails response if invalid. Uses a backup endpoint for reliability in live mode.\n\n    Args:\n        mode (str): Required. Values are \"1\", \"2\", or \"3\". Specifies the validation mode (1: USPS datasets, 2: non-USPS datasets, 3: name\/phone-assisted).\n        address1 (str): Required. The primary address line or single-line address.\n        address2 (str, optional): Optional. The secondary address line (e.g., suite or apartment number).\n        city (str, optional): The city of the address. Required if ZIP is not provided.\n        state (str, optional): The state of the address. Required if ZIP is not provided.\n        zip_code (str, optional): The ZIP code of the address. Required if City and State are not provided.\n        business_name (str, optional): Optional. Company name for business addresses, may append SuiteLink data.\n        first_name (str, optional):Optional. First name of the contact, used in Mode 3.\n        middle_name (str, optional): Optional. Middle name of the contact, used in Mode 3.\n        last_name (str, optional): Optional. Last name of the contact, used in Mode 3.\n        phone_number (str, optional): Optional. Phone number for the contact, enables features like PhoneLink.\n        options (str, optional): Optional. Reserved for future use.\n        auth_id (str): Required. Required. Authentication ID provided by Service Objects.\n        is_live (bool, optional): Option to use live service (true) or trial service (false).\n        timeout_seconds (int, optional): Timeout in seconds for the HTTP request. Defaults to 15.\n\n    Returns:\n        AV4Response: Parsed JSON response with validated address details or a ProblemDetails if validation fails or the API call fails.\n    \"\"\"\n\n    params = {\n        'Mode': mode,\n        'Address1': address1,\n        'Address2': address2,\n        'City': city,\n        'State': state,\n        'ZIP': zip_code,\n        'BusinessName': business_name,\n        'FirstName': first_name,\n        'MiddleName': middle_name,\n        'LastName': last_name,\n        'PhoneNumber': phone_number,\n        'Options': options,\n        'AuthID': auth_id\n    }\n\n    url = primary_url if is_live else trial_url\n\n    try:\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        problem_details = data.get('ProblemDetails')\n        if problem_details:\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                problem_details = data.get('ProblemDetails')\n                if problem_details:\n                    return AV4Response(\n                        Status=None,\n                        Addresses=None,\n                        ParsedInput=None,\n                        ProblemDetails=ProblemDetails(**problem_details)\n                    )\n            else:\n                # Trial mode error is terminal\n                return AV4Response(\n                    Status=None,\n                    Addresses=None,\n                    ParsedInput=None,\n                    ProblemDetails=ProblemDetails(**problem_details)\n                )\n\n        addresses = [AddressInfo(**addr) for addr in data.get('addresses', [])] if data.get('addresses') else None\n        parsed_input = ParsedInputInfo(**data.get('parsedInput', {})) if data.get('parsedInput') else None\n\n        return AV4Response(\n            Status=data.get('status'),\n            Addresses=addresses,\n            ParsedInput=parsed_input,\n            ProblemDetails=None\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                problem_details = data.get('ProblemDetails')\n                if problem_details:\n                    return AV4Response(\n                        Status=None,\n                        Addresses=None,\n                        ParsedInput=None,\n                        ProblemDetails=ProblemDetails(**problem_details)\n                    )\n\n                addresses = [AddressInfo(**addr) for addr in data.get('addresses', [])] if data.get('addresses') else None\n                parsed_input = ParsedInputInfo(**data.get('parsedInput', {})) if data.get('parsedInput') else None\n\n                return AV4Response(\n                    Status=data.get('status'),\n                    Addresses=addresses,\n                    ParsedInput=parsed_input,\n                    ProblemDetails=None\n                )\n            except Exception as backup_exc:\n                data = json.loads(backup_exc.response.content)\n                problem_details = ProblemDetails(\n                    Type=data[\"type\"],\n                    Title=data[\"title\"],\n                    Status=data[\"status\"]\n                )\n                return AV4Response(\n                    Status=None,\n                    Addresses=None,\n                    ParsedInput=None,\n                    ProblemDetails=problem_details\n                )\n        else:\n            data = json.loads(req_exc.response.content)\n            problem_details = ProblemDetails(\n                Type=data[\"type\"],\n                Title=data[\"title\"],\n                Status=data[\"status\"]\n            )\n            return AV4Response(\n                Status=None,\n                Addresses=None,\n                ParsedInput=None,\n                ProblemDetails=problem_details\n            )\n\n\n\n\nfrom dataclasses import dataclass\nfrom typing import Optional, List\n\n@dataclass\nclass AddressInfo:\n    rating: Optional[str] = None\n    validationType: Optional[str] = None\n    validationTypeValue: Optional[int] = 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    countyName: Optional[str] = None\n    primaryNumber: Optional[str] = None\n    preDirectional: Optional[str] = None\n    postDirectional: Optional[str] = None\n    streetName: Optional[str] = None\n    streetSuffix: Optional[str] = None\n    secondaryType: Optional[str] = None\n    secondaryNumber: Optional[str] = None\n    pmbType: Optional[str] = None\n    pmbNumber: Optional[str] = None\n    barcodeDigits: Optional[str] = None\n    carrierRoute: Optional[str] = None\n    congressCode: Optional[str] = None\n    addressNotes: Optional[List[str]] = None\n\n@dataclass\nclass ParsedInputInfo:\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    primaryNumber: Optional[str] = None\n    preDirectional: Optional[str] = None\n    postDirectional: Optional[str] = None\n    streetName: Optional[str] = None\n    streetSuffix: Optional[str] = None\n    secondaryType: Optional[str] = None\n    secondaryNumber: Optional[str] = None\n    phoneNumber: Optional[str] = None\n    firstName: Optional[str] = None\n    middleName: Optional[str] = None\n    lastName: Optional[str] = None\n\n@dataclass\nclass ProblemDetails:\n    title: Optional[str] = None\n    status: Optional[str] = None\n    detail: Optional[str] = None\n\n@dataclass\nclass AV4Response:\n    Status: Optional[str] = None\n    Addresses: Optional[List[AddressInfo]] = None\n    ParsedInput: Optional[ParsedInputInfo] = None\n    ProblemDetails: Optional[ProblemDetails] = None<\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong>Address Validation US 4 NodeJS<\/strong> <strong>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 { AV4Response } from '.\/av4_response.js';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the live ServiceObjects Address Validation US 4 API service.\n *\/\nconst LiveBaseUrl = 'https:\/\/sws.serviceobjects.com\/AV4\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the backup ServiceObjects Address Validation US 4 API service.\n *\/\nconst BackupBaseUrl = 'https:\/\/swsbackup.serviceobjects.com\/AV4\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the trial ServiceObjects Address Validation US 4 API service.\n *\/\nconst TrialBaseUrl = 'https:\/\/trial.serviceobjects.com\/AV4\/';\n\n\/**\n * Checks if a response from the API is valid by verifying that it either has no Error object\n * or the Error object does not have Status \"500\" (server error).\n * @param {AV4Response} response - The API response object to validate.\n * @returns {boolean} True if the response is valid, false otherwise.\n *\/\nconst isValid = (response) => !response?.ProblemDetails || response.ProblemDetails.status !== 500;\n\n\/**\n * Constructs a full URL for the ValidateAddress API endpoint by combining the base URL\n * with URL-encoded 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}ValidateAddress?${querystring.stringify(params)}`;\n\n\/**\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;AV4Response>} A promise that resolves to an AV4Response object containing the API response data.\n * @throws {Error} If the HTTP request fails, with a message detailing the error.\n *\/\nexport const httpGet = async (url, timeoutSeconds) => {\n    let result = new AV4Response();\n    try {\n        const response = await axios.get(url, { timeout: timeoutSeconds * 1000 });\n\n        if (response.status === 200) {\n            result.Status = response.data.status ?? null;\n            result.Addresses = response.data.addresses ?? null;\n            result.ParsedInput = response.data.parsedInput ?? null;\n            result.ProblemDetails = null;\n        } else {\n            result.ProblemDetails = {\n                Title: \"Service Objects Error\",\n                Status: response.status,\n                Detail: response.statusText\n            };\n            result.Status = null;\n            result.Addresses = null;\n            result.ParsedInput = null;\n        }\n    } catch (error) {\n        result.ProblemDetails = {\n            type: error.response.data.type,\n            title: error.response.data.title,\n            status: error.response.data.status,\n            detail: error.response.data.detail\n        };\n        result.Status = null;\n        result.Addresses = null;\n        result.ParsedInput = null;\n    }\n    return result;\n};\n\n\/**\n * Provides functionality to call the ServiceObjects Address Validation US 4 API's ValidateAddress endpoint,\n * retrieving parsed and validated address elements including Delivery Point Validation (DPV),\n * Residential Delivery Indicator (RDI), and Suite data with fallback to a backup endpoint for reliability in live mode.\n *\/\nconst ValidateAddressClient = {\n    \/**\n     * Asynchronously invokes the ValidateAddress API endpoint, validating input parameters\n     * and attempting the primary endpoint first, falling back to the backup if the response\n     * is invalid (Error.TypeCode == '422') in live mode.\n     * @param {string} Mode - Required. Values are \"1\", \"2\", or \"3\". Specifies the validation mode (1: USPS datasets, 2: non-USPS datasets, 3: name\/phone-assisted).\n     * @param {string} Address1 - Required. The primary address line or single-line address.\n     * @param {string} [Address2] - Optional. The secondary address line (e.g., suite or apartment number).\n     * @param {string} [City] - The city of the address. Required if ZIP is not provided.\n     * @param {string} [State] - The state of the address. Required if ZIP is not provided.\n     * @param {string} [ZIP] - The ZIP code of the address. Required if City and State are not provided.\n     * @param {string} [BusinessName] - Optional. Company name for business addresses, may append SuiteLink data.\n     * @param {string} [FirstName] - Optional. First name of the contact, used in Mode 3.\n     * @param {string} [MiddleName] - Optional. Middle name of the contact, used in Mode 3.\n     * @param {string} [LastName] - Optional. Last name of the contact, used in Mode 3.\n     * @param {string} [PhoneNumber] - Optional. Phone number for the contact, enables features like PhoneLink.\n     * @param {string} [Options] - Optional. Reserved for future use.\n     * @param {string} AuthID - Required. Authentication ID provided by Service Objects.\n     * @param {boolean} [isLive=true] - Option to use live service (true) or trial service (false).\n     * @param {number} [timeoutSeconds=15] - Timeout in seconds for the HTTP request.\n     * @returns {Promise&lt;AV4Response>} A promise that resolves to an AV4Response object with validated address details or an error.\n     *\/\n    async invokeAsync(Mode, Address1, Address2, City, State, ZIP,BusinessName, FirstName, MiddleName, LastName,\n        PhoneNumber, Options, AuthID, isLive = true, timeoutSeconds = 15) {\n        const params = {\n            Mode,Address1, Address2, City, State,ZIP, BusinessName, FirstName, MiddleName, LastName,\n            PhoneNumber, Options, AuthID\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\n        return response;\n    },\n\n    \/**\n     * Synchronously invokes the ValidateAddress API endpoint by wrapping the async call\n     * and awaiting its result immediately. Note: This method should be used cautiously\n     * in Node.js as it blocks the event loop.\n     * @param {string} Mode - Required. Values are \"1\", \"2\", or \"3\". Specifies the validation mode (1: USPS datasets, 2: non-USPS datasets, 3: name\/phone-assisted).\n     * @param {string} Address1 - Required. The primary address line or single-line address.\n     * @param {string} [Address2] - Optional. The secondary address line (e.g., suite or apartment number).\n     * @param {string} [City] - The city of the address. Required if ZIP is not provided.\n     * @param {string} [State] - The state of the address. Required if ZIP is not provided.\n     * @param {string} [ZIP] - The ZIP code of the address. Required if City and State are not provided.\n     * @param {string} [BusinessName] - Optional. Company name for business addresses, may append SuiteLink data.\n     * @param {string} [FirstName] - Optional. First name of the contact, used in Mode 3.\n     * @param {string} [MiddleName] - Optional. Middle name of the contact, used in Mode 3.\n     * @param {string} [LastName] - Optional. Last name of the contact, used in Mode 3.\n     * @param {string} [PhoneNumber] - Optional. Phone number for the contact, enables features like PhoneLink.\n     * @param {string} [Options] - Optional. Reserved for future use.\n     * @param {string} AuthID - Required. Authentication ID provided by Service Objects.\n     * * @param {boolean} [isLive=true] - Option to use live service (true) or trial service (false).\n     * @param {number} [timeoutSeconds=15] - Timeout in seconds for the HTTP request.\n     * @returns {AV4Response} An AV4Response object with validated address details or an error.\n     *\/\n    invoke(Mode, Address1, Address2, City, State, ZIP, BusinessName, FirstName, MiddleName, LastName,\n        PhoneNumber, Options, AuthID, isLive = true, timeoutSeconds = 15) {\n        return (async () => await this.invokeAsync(\n            Mode, Address1, Address2, City, State, ZIP, BusinessName, FirstName, MiddleName, LastName,\n            PhoneNumber, Options, AuthID, isLive, timeoutSeconds\n        ))();\n    }\n};\n\nexport { ValidateAddressClient, AV4Response };\n\n\nexport class AddressInfo {\n    constructor(data = {}) {\n        this.rating = data.rating;\n        this.validationType = data.validationType;\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.countyName = data.countyName;\n        this.primaryNumber = data.primaryNumber;\n        this.preDirectional = data.preDirectional;\n        this.postDirectional = data.postDirectional;\n        this.streetName = data.streetName;\n        this.streetSuffix = data.streetSuffix;\n        this.secondaryType = data.secondaryType;\n        this.secondaryNumber = data.secondaryNumber;\n        this.pmbType = data.pmbType;\n        this.pmbNumber = data.pmbNumber;\n        this.barcodeDigits = data.barcodeDigits;\n        this.carrierRoute = data.carrierRoute;\n        this.congressCode = data.congressCode;\n        this.addressNotes = data.addressNotes || [];\n    }\n\n    toString() {\n        const addressNotesString = this.addressNotes.length \n            ? this.addressNotes.join(', ') \n            : 'null';\n        return `AddressInfo: rating=${this.rating}, validationType=${this.validationType}, ` +\n               `address=${this.address}, addressExtra=${this.addressExtra}, city=${this.city}, ` +\n               `state=${this.state}, zip=${this.zip}, countyName=${this.countyName}, ` +\n               `primaryNumber=${this.primaryNumber}, preDirectional=${this.preDirectional}, ` +\n               `postDirectional=${this.postDirectional}, streetName=${this.streetName}, ` +\n               `streetSuffix=${this.streetSuffix}, secondaryType=${this.secondaryType}, ` +\n               `secondaryNumber=${this.secondaryNumber}, pmbType=${this.pmbType}, ` +\n               `pmbNumber=${this.pmbNumber}, barcodeDigits=${this.barcodeDigits}, ` +\n               `carrierRoute=${this.carrierRoute}, congressCode=${this.congressCode}, ` +\n               `addressNotes=[${addressNotesString}]`;\n    }\n}\n\nexport class ParsedInputInfo {\n    constructor(data = {}) {\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.primaryNumber = data.primaryNumber;\n        this.preDirectional = data.preDirectional;\n        this.postDirectional = data.postDirectional;\n        this.streetName = data.streetName;\n        this.streetSuffix = data.streetSuffix;\n        this.secondaryType = data.secondaryType;\n        this.secondaryNumber = data.secondaryNumber;\n        this.phoneNumber = data.phoneNumber;\n        this.firstName = data.firstName;\n        this.middleName = data.middleName;\n        this.lastName = data.lastName;\n    }\n\n    toString() {\n        return `ParsedInputInfo: address=${this.address}, addressExtra=${this.addressExtra}, ` +\n               `city=${this.city}, state=${this.state}, zip=${this.zip}, ` +\n               `primaryNumber=${this.primaryNumber}, preDirectional=${this.preDirectional}, ` +\n               `postDirectional=${this.postDirectional}, streetName=${this.streetName}, ` +\n               `streetSuffix=${this.streetSuffix}, secondaryType=${this.secondaryType}, ` +\n               `secondaryNumber=${this.secondaryNumber}, phoneNumber=${this.phoneNumber}, ` +\n               `firstName=${this.firstName}, middleName=${this.middleName}, lastName=${this.lastName}`;\n    }\n}\n\nexport class ProblemDetails {\n    constructor({ type = null, title = null, status = null, detail = null } = {}) {\n        this.type = type;\n        this.title = title;\n        this.status = status;\n        this.detail = detail;\n    }\n\n    toString() {\n        return `Type: ${this.type} Title: ${this.title} Status: ${this.status} Detail: ${this.detail}`;\n    }\n}\n\nexport class AV4Response {\n    constructor(data = {}) {\n        this.Status = data.status;\n        this.Addresses = (data.addresses  || []).map(addr => new AddressInfo(addr));\n        this.ParsedInput = data.parsedInput ? new ParsedInputInfo(data.parsedInput) : null;\n        this.ProblemDetails = data.ProblemDetails\n            ? new ProblemDetails(\n                data.ProblemDetails.Type,\n                data.ProblemDetails.Title,\n                data.ProblemDetails.Status,\n                data.ProblemDetails.Detail\n              )\n            : null;\n    }\n\n    toString() {\n        const addressesString = this.addresses.length \n            ? this.addresses.map(addr => addr.toString()).join(', ') \n            : 'null';\n        return `ValidateAddressResponse:\\nStatus: ${this.status}\\nAddresses: ${addressesString}\\nParsedInput: ${this.parsedInput ? this.parsedInput.toString() : 'null'}\\nProblemDetails: ${this.problemDetails ? this.problemDetails.toString() : 'null'}`;\n    }\n}\n\nexport default AV4Response;<\/pre>\n<\/div>\n<\/div><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":21,"featured_media":0,"parent":10099,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-10101","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>AV4 \u2013 REST\u00a0<\/title>\n<meta name=\"description\" content=\"C#PythonNodeJS Address Validation US 4 C# Rest Code Snippet \ufeffusing System; using System.Text.Json; using System.Threading.Tasks; using System.Web;\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AV4 \u2013 REST\u00a0\" \/>\n<meta property=\"og:description\" content=\"C#PythonNodeJS Address Validation US 4 C# Rest Code Snippet \ufeffusing System; using System.Text.Json; using System.Threading.Tasks; using System.Web;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-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-27T22:44:34+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/\",\"name\":\"AV4 \u2013 REST\u00a0\",\"isPartOf\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#website\"},\"datePublished\":\"2024-08-30T19:02:31+00:00\",\"dateModified\":\"2025-09-27T22:44:34+00:00\",\"description\":\"C#PythonNodeJS Address Validation US 4 C# Rest Code Snippet \ufeffusing System; using System.Text.Json; using System.Threading.Tasks; using System.Web;\",\"breadcrumb\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DOTS Address Validation &#8211; US 4\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"AV4 &#8211; Code Snippets and Sample Code\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"AV4 \u2013 REST\u00a0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#website\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/\",\"name\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.serviceobjects.com\/docs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#organization\",\"name\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png\",\"contentUrl\":\"https:\/\/www.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png\",\"width\":2560,\"height\":1440,\"caption\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\"},\"image\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AV4 \u2013 REST\u00a0","description":"C#PythonNodeJS Address Validation US 4 C# Rest Code Snippet \ufeffusing System; using System.Text.Json; using System.Threading.Tasks; using System.Web;","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/","og_locale":"en_US","og_type":"article","og_title":"AV4 \u2013 REST\u00a0","og_description":"C#PythonNodeJS Address Validation US 4 C# Rest Code Snippet \ufeffusing System; using System.Text.Json; using System.Threading.Tasks; using System.Web;","og_url":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/","og_site_name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","article_modified_time":"2025-09-27T22:44:34+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/","url":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/","name":"AV4 \u2013 REST\u00a0","isPartOf":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#website"},"datePublished":"2024-08-30T19:02:31+00:00","dateModified":"2025-09-27T22:44:34+00:00","description":"C#PythonNodeJS Address Validation US 4 C# Rest Code Snippet \ufeffusing System; using System.Text.Json; using System.Threading.Tasks; using System.Web;","breadcrumb":{"@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/av4-rest\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.serviceobjects.com\/docs\/"},{"@type":"ListItem","position":2,"name":"DOTS Address Validation &#8211; US 4","item":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/"},{"@type":"ListItem","position":3,"name":"AV4 &#8211; Code Snippets and Sample Code","item":"https:\/\/www.serviceobjects.com\/docs\/dots-address-validation-us-4\/av4-code-snippets-and-sample-code\/"},{"@type":"ListItem","position":4,"name":"AV4 \u2013 REST\u00a0"}]},{"@type":"WebSite","@id":"https:\/\/www.serviceobjects.com\/docs\/#website","url":"https:\/\/www.serviceobjects.com\/docs\/","name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","description":"","publisher":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.serviceobjects.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.serviceobjects.com\/docs\/#organization","name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","url":"https:\/\/www.serviceobjects.com\/docs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.serviceobjects.com\/docs\/#\/schema\/logo\/image\/","url":"https:\/\/www.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png","contentUrl":"https:\/\/www.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png","width":2560,"height":1440,"caption":"Service Objects | Contact, Phone, Email Verification | Data Quality Services"},"image":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/10101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/comments?post=10101"}],"version-history":[{"count":17,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/10101\/revisions"}],"predecessor-version":[{"id":12365,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/10101\/revisions\/12365"}],"up":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/10099"}],"wp:attachment":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/media?parent=10101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}