{"id":5675,"date":"2022-11-14T23:17:03","date_gmt":"2022-11-14T23:17:03","guid":{"rendered":"https:\/\/serviceobjects.wpaladdin.com\/?page_id=5675"},"modified":"2025-09-26T13:16:28","modified_gmt":"2025-09-26T20:16:28","slug":"nv2-rest","status":"publish","type":"page","link":"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/","title":{"rendered":"NV2 &#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>Name Validation 2 C# 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=\"\">\ufeff\nnamespace name_validation_2_dot_net.REST\n{\n    \/\/\/ &lt;summary>\n    \/\/\/ Provides functionality to call the ServiceObjects DOTS Name Validation 2 REST API's NameInfoV2 endpoint,\n    \/\/\/ retrieving name validation information (e.g., name parsing, gender, scores) with fallback to a backup endpoint\n    \/\/\/ for reliability in live mode.\n    \/\/\/ &lt;\/summary>\n    public class NameInfoV2Client\n    {\n        private const string LiveBaseUrl = \"https:\/\/sws.serviceobjects.com\/NV2\/api.svc\/\";\n        private const string BackupBaseUrl = \"https:\/\/swsbackup.serviceobjects.com\/NV2\/api.svc\/\";\n        private const string TrialBaseUrl = \"https:\/\/trial.serviceobjects.com\/NV2\/api.svc\/\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Synchronously calls the NameInfoV2 REST endpoint to retrieve name validation 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 name, option, license key.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"NameInfoV2Response\"\/>.&lt;\/returns>\n        public static NameInfoV2Response Invoke(GetNameInfoInput input)\n        {\n            \/\/ Use query string parameters so missing\/optional fields don't break\n            \/\/ the URL as path parameters would.\n            string url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            NameInfoV2Response response = Helper.HttpGet&lt;NameInfoV2Response>(url, input.TimeoutSeconds);\n\n            \/\/ Fallback on error in live mode\n            if (input.IsLive &amp;&amp; !IsValid(response))\n            {\n                string fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                NameInfoV2Response fallbackResponse = Helper.HttpGet&lt;NameInfoV2Response>(fallbackUrl, input.TimeoutSeconds);\n                return fallbackResponse;\n            }\n\n            return response;\n        }\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Asynchronously calls the NameInfoV2 REST endpoint to retrieve name validation 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 name, option, license key.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"NameInfoV2Response\"\/>.&lt;\/returns>\n        public static async Task&lt;NameInfoV2Response> InvokeAsync(GetNameInfoInput input)\n        {\n            \/\/ Use query string parameters so missing\/optional fields don't break\n            \/\/ the URL as path parameters would.\n            string url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            NameInfoV2Response response = await Helper.HttpGetAsync&lt;NameInfoV2Response>(url, input.TimeoutSeconds).ConfigureAwait(false);\n            if (input.IsLive &amp;&amp; !IsValid(response))\n            {\n                string fallbackUrl = BuildUrl(input, BackupBaseUrl);\n                NameInfoV2Response fallbackResponse = await Helper.HttpGetAsync&lt;NameInfoV2Response>(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(GetNameInfoInput input, string baseUrl)\n        {\n            string qs = \"NameInfoV2?\" +\n                        $\"Name={Helper.UrlEncode(input.Name)}\" +\n                        $\"&amp;Option={Helper.UrlEncode(input.Option)}\" +\n                        $\"&amp;LicenseKey={Helper.UrlEncode(input.LicenseKey)}\" +\n                        \"&amp;format=json\";\n            return baseUrl + qs;\n        }\n\n        private static bool IsValid(NameInfoV2Response response) =>\n            response?.Error == null || response.Error.TypeCode != \"3\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ This is the primary operation for validating and parsing a name. Given a name and optional parameters,\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"Name\">The name to validate (required).&lt;\/param>\n        \/\/\/ &lt;param name=\"Option\">Comma-separated list of options for additional processing (optional).&lt;\/param>\n        \/\/\/ &lt;param name=\"LicenseKey\">Your license key to use the service.&lt;\/param>\n        \/\/\/ &lt;param name=\"IsLive\">Option to use live service or trial service.&lt;\/param>\n        \/\/\/ &lt;param name=\"TimeoutSeconds\">Timeout, in seconds, for the call to the service.&lt;\/param>\n        public record GetNameInfoInput(\n            string Name = \"\",\n            string Option = \"\",\n            string LicenseKey = \"\",\n            bool IsLive = true,\n            int TimeoutSeconds = 15\n        );\n    }\n}\n\n\n\ufeff\nnamespace name_validation_2_dot_net.REST\n{\n    public class NameInfoV2Response\n    {\n        public NameInfoV2 NameInfoV2 { get; set; }\n\n        public Error Error { get; set; }\n        public override string ToString()\n        {\n            return $\"NameInfoV2: {NameInfoV2}\\n\" +\n                $\"Error: {{{Error}}}\";\n        }\n    }\n    public class NameInfoV2\n    {\n        public BestGuessName BestGuessName { get; set; }\n        public string NameIn { get; set; }\n        public string NameClassification { get; set; }\n        public string Prefix { get; set; }\n        public string FirstName { get; set; }\n        public string MiddleName { get; set; }\n        public string LastName { get; set; }\n        public string Suffix { get; set; }\n        public bool FirstNameFound { get; set; }\n        public bool IsCommonFirstName { get; set; }\n        public string FirstNameOrigin { get; set; }\n        public string FirstNameSimilar { get; set; }\n        public bool LastNameFound { get; set; }\n        public bool IsCommonLastName { get; set; }\n        public string LastNameOrigin { get; set; }\n        public string LastNameSimilar { get; set; }\n        public string Gender { get; set; }\n        public string FirstNameAlt { get; set; }\n        public string MiddleNameAlt { get; set; }\n        public string LastNameAlt { get; set; }\n        public bool FirstNameAltFound { get; set; }\n        public bool LastNameAltFound { get; set; }\n        public string GenderAlt { get; set; }\n        public string RelatedNames { get; set; }\n        public bool IsCorrectedName { get; set; }\n        public bool IsBusinessName { get; set; }\n        public string BusinessName { get; set; }\n        public int VulgarityScore { get; set; }\n        public int CelebrityScore { get; set; }\n        public int BogusScore { get; set; }\n        public int GarbageScore { get; set; }\n        public int FirstNameDictionaryScore { get; set; }\n        public int MiddleNameDictionaryScore { get; set; }\n        public int LastNameDictionaryScore { get; set; }\n        public int OverallNameScore { get; set; }\n        public string IsNameGood { get; set; }\n        public string StatusCodes { get; set; }\n        public string Status { get; set; }\n        public override string ToString()\n        {\n            string Output = $\"{{BestGuessName: {BestGuessName}\\n\" +\n                $\"NameIn: {NameIn}\\n\" +\n                $\"NameClassification: {NameClassification}\\n\" +\n                $\"Prefix: {Prefix}\\n\" +\n                $\"FirstName:  {FirstName}\\n\" +\n                $\"MiddleName: {MiddleName}\\n\" +\n                $\"LastName:  {LastName}\\n\" +\n                $\"Suffix:   {Suffix}\\n\" +\n                $\"FirstNameFound: {FirstNameFound}\\n\" +\n                $\"IsCommonFirstName: {IsCommonFirstName}\\n\" +\n                $\"FirstNameOrigin: {FirstNameOrigin}\\n\" +\n                $\"FirstNameSimilar: {FirstNameSimilar}\\n\" +\n                $\"LastNameFound: {LastNameFound}\\n\" +\n                $\"IsCommonLastName: {IsCommonLastName}\\n\" +\n                $\"LastNameOrigin: {LastNameOrigin}\\n\" +\n                $\"LastNameSimilar: {LastNameSimilar}\\n\" +\n                $\"Gender: {Gender}\\n\" +\n                $\"FirstNameAlt: {FirstNameAlt}\\n\" +\n                $\"MiddleNameAlt: {MiddleNameAlt}\\n\" +\n                $\"LastNameAlt: {LastNameAlt}\\n\" +\n                $\"FirstNameAltFound: {FirstNameAltFound}\\n\" +\n                $\"LastNameAltFound: {LastNameAltFound}\\n\" +\n                $\"GenderAlt: {GenderAlt}\\n\" +\n                $\"RelatedNames: {RelatedNames}\\n\" +\n                $\"IsCorrectedName: {IsCorrectedName}\\n\" +\n                $\"IsBusinessName: {IsBusinessName}\\n\" +\n                $\"BusinessName: {BusinessName}\\n\" +\n                $\"VulgarityScore: {VulgarityScore}\\n\" +\n                $\"CelebrityScore: {CelebrityScore}\\n\" +\n                $\"BogusScore: {BogusScore}\\n\" +\n                $\"GarbageScore: {GarbageScore}\\n\" +\n                $\"FirstNameDictionaryScore: {FirstNameDictionaryScore}\\n\" +\n                $\"MiddleNameDictionaryScore: {MiddleNameDictionaryScore}\\n\" +\n                $\"LastNameDictionaryScore: {LastNameDictionaryScore}\\n\" +\n                $\"OverallNameScore: {OverallNameScore}\\n\" +\n                $\"IsNameGood: {IsNameGood}\\n\" +\n                $\"StatusCodes: {StatusCodes}\\n\" +\n                $\"Status: {Status}\\n\";\n            return Output;\n        }\n\n    }\n    public class BestGuessName\n    {\n        public string Prefix { get; set; }\n        public string FirstName { get; set; }\n        public string MiddleName { get; set; }\n        public string LastName { get; set; }\n        public string Suffix { get; set; }\n        public override string ToString()\n        {\n            return $\"{{Prefix: {Prefix}\\n\" +\n            $\"FirstName: {FirstName}\\n\" +\n            $\"MiddleName: {MiddleName}\\n\" +\n            $\"LastName: {LastName}\\n\" +\n            $\"Suffix: {Suffix} }}\\n\";\n        }\n    }\n    public class Error\n    {\n        public string Type { get; set; }\n\n        public string TypeCode { get; set; }\n\n        public string Desc { get; set; }\n\n        public string DescCode { get; set; }\n        public override string ToString()\n        {\n            return $\"Type: {Type}\\n\" +\n                $\"TypeCode: {TypeCode}\\n\" +\n                $\"Desc: {Desc}\\n\" +\n                $\"DescCode: {DescCode} \";\n        }\n    }\n\n}\n\n\n\ufeffusing System.Text.Json;\nusing System.Web;\n\nnamespace name_validation_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>Name Validation 2 Python Code Snippet<\/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=\"\">import requests\nfrom nv2_response import NameInfoV2Response, NameInfoV2, BestGuessName, Error\n\n# Endpoint URLs for Name Validation 2 NameInfoV2 REST API\nprimary_url = 'https:\/\/sws.serviceobjects.com\/NV2\/api.svc\/NameInfoV2?'\nbackup_url = 'https:\/\/swsbackup.serviceobjects.com\/NV2\/api.svc\/NameInfoV2?'\ntrial_url = 'https:\/\/trial.serviceobjects.com\/NV2\/api.svc\/NameInfoV2?'\n\ndef get_name_info_v2(\n    name: str,\n    option: str,\n    license_key: str,\n    is_live: bool = True,\n    timeout_seconds: int = 15\n) -> NameInfoV2Response:\n    \"\"\"\n    Call Name Validation 2 NameInfoV2 API to retrieve name validation information.\n\n    Parameters:\n        name: The name to validate.\n        option: Comma-separated list of options for additional processing (optional).\n        license_key: Your license key to use the service.\n        is_live: Value to determine whether to use the live or trial servers (default: True).\n        timeout_seconds: Timeout, in seconds, for the call to the service (default: 15).\n\n    Returns:\n        NameInfoV2Response: Parsed JSON response with name information or error details.\n    \"\"\"\n    params = {\n        'Name': name,\n        'Option': option,\n        'LicenseKey': license_key,\n        'format': 'json' \n    }\n\n    # Select the base URL: production vs trial\n    url = primary_url if is_live else trial_url\n\n    # Attempt primary (or trial) endpoint first\n    try:\n        response = requests.get(url, params=params, timeout=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 = getattr(response, 'Error', None)\n        if not (error is None or getattr(error, 'TypeCode', None) != \"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\"NV2 service error: {data['Error']}\")\n\n            else:\n                # Trial mode error is terminal\n                raise RuntimeError(f\"NV2 trial error: {data['Error']}\")\n\n        # Convert JSON response to NameInfoV2Response for structured access\n        error = Error(**data.get('Error', {})) if data.get('Error') else None\n        name_info_v2 = None\n        if data.get('NameInfoV2'):\n            best_guess_name = BestGuessName(**data['NameInfoV2'].get('BestGuessName', {})) if data['NameInfoV2'].get('BestGuessName') else None\n            name_info_v2 = NameInfoV2(\n                BestGuessName=best_guess_name,\n                NameIn=data['NameInfoV2'].get('NameIn'),\n                NameClassification=data['NameInfoV2'].get('NameClassification'),\n                Prefix=data['NameInfoV2'].get('Prefix'),\n                FirstName=data['NameInfoV2'].get('FirstName'),\n                MiddleName=data['NameInfoV2'].get('MiddleName'),\n                LastName=data['NameInfoV2'].get('LastName'),\n                Suffix=data['NameInfoV2'].get('Suffix'),\n                FirstNameFound=data['NameInfoV2'].get('FirstNameFound'),\n                IsCommonFirstName=data['NameInfoV2'].get('IsCommonFirstName'),\n                FirstNameOrigin=data['NameInfoV2'].get('FirstNameOrigin'),\n                FirstNameSimilar=data['NameInfoV2'].get('FirstNameSimilar'),\n                LastNameFound=data['NameInfoV2'].get('LastNameFound'),\n                IsCommonLastName=data['NameInfoV2'].get('IsCommonLastName'),\n                LastNameOrigin=data['NameInfoV2'].get('LastNameOrigin'),\n                LastNameSimilar=data['NameInfoV2'].get('LastNameSimilar'),\n                Gender=data['NameInfoV2'].get('Gender'),\n                FirstNameAlt=data['NameInfoV2'].get('FirstNameAlt'),\n                MiddleNameAlt=data['NameInfoV2'].get('MiddleNameAlt'),\n                LastNameAlt=data['NameInfoV2'].get('LastNameAlt'),\n                FirstNameAltFound=data['NameInfoV2'].get('FirstNameAltFound'),\n                LastNameAltFound=data['NameInfoV2'].get('LastNameAltFound'),\n                GenderAlt=data['NameInfoV2'].get('GenderAlt'),\n                RelatedNames=data['NameInfoV2'].get('RelatedNames'),\n                IsCorrectedName=data['NameInfoV2'].get('IsCorrectedName'),\n                IsBusinessName=data['NameInfoV2'].get('IsBusinessName'),\n                BusinessName=data['NameInfoV2'].get('BusinessName'),\n                VulgarityScore=data['NameInfoV2'].get('VulgarityScore'),\n                CelebrityScore=data['NameInfoV2'].get('CelebrityScore'),\n                BogusScore=data['NameInfoV2'].get('BogusScore'),\n                GarbageScore=data['NameInfoV2'].get('GarbageScore'),\n                FirstNameDictionaryScore=data['NameInfoV2'].get('FirstNameDictionaryScore'),\n                MiddleNameDictionaryScore=data['NameInfoV2'].get('MiddleNameDictionaryScore'),\n                LastNameDictionaryScore=data['NameInfoV2'].get('LastNameDictionaryScore'),\n                OverallNameScore=data['NameInfoV2'].get('OverallNameScore'),\n                IsNameGood=data['NameInfoV2'].get('IsNameGood'),\n                StatusCodes=data['NameInfoV2'].get('StatusCodes'),\n                Status=data['NameInfoV2'].get('Status')\n            )\n\n        return NameInfoV2Response(\n            NameInfoV2=name_info_v2,\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 on network failure\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\"NV2 backup error: {data['Error']}\") from req_exc\n\n                # Convert JSON response to NameInfoV2Response for structured access\n                error = Error(**data.get('Error', {})) if data.get('Error') else None\n                name_info_v2 = None\n                if data.get('NameInfoV2'):\n                    best_guess_name = BestGuessName(**data['NameInfoV2'].get('BestGuessName', {})) if data['NameInfoV2'].get('BestGuessName') else None\n                    name_info_v2 = NameInfoV2(\n                        BestGuessName=best_guess_name,\n                        NameIn=data['NameInfoV2'].get('NameIn'),\n                        NameClassification=data['NameInfoV2'].get('NameClassification'),\n                        Prefix=data['NameInfoV2'].get('Prefix'),\n                        FirstName=data['NameInfoV2'].get('FirstName'),\n                        MiddleName=data['NameInfoV2'].get('MiddleName'),\n                        LastName=data['NameInfoV2'].get('LastName'),\n                        Suffix=data['NameInfoV2'].get('Suffix'),\n                        FirstNameFound=data['NameInfoV2'].get('FirstNameFound'),\n                        IsCommonFirstName=data['NameInfoV2'].get('IsCommonFirstName'),\n                        FirstNameOrigin=data['NameInfoV2'].get('FirstNameOrigin'),\n                        FirstNameSimilar=data['NameInfoV2'].get('FirstNameSimilar'),\n                        LastNameFound=data['NameInfoV2'].get('LastNameFound'),\n                        IsCommonLastName=data['NameInfoV2'].get('IsCommonLastName'),\n                        LastNameOrigin=data['NameInfoV2'].get('LastNameOrigin'),\n                        LastNameSimilar=data['NameInfoV2'].get('LastNameSimilar'),\n                        Gender=data['NameInfoV2'].get('Gender'),\n                        FirstNameAlt=data['NameInfoV2'].get('FirstNameAlt'),\n                        MiddleNameAlt=data['NameInfoV2'].get('MiddleNameAlt'),\n                        LastNameAlt=data['NameInfoV2'].get('LastNameAlt'),\n                        FirstNameAltFound=data['NameInfoV2'].get('FirstNameAltFound'),\n                        LastNameAltFound=data['NameInfoV2'].get('LastNameAltFound'),\n                        GenderAlt=data['NameInfoV2'].get('GenderAlt'),\n                        RelatedNames=data['NameInfoV2'].get('RelatedNames'),\n                        IsCorrectedName=data['NameInfoV2'].get('IsCorrectedName'),\n                        IsBusinessName=data['NameInfoV2'].get('IsBusinessName'),\n                        BusinessName=data['NameInfoV2'].get('BusinessName'),\n                        VulgarityScore=data['NameInfoV2'].get('VulgarityScore'),\n                        CelebrityScore=data['NameInfoV2'].get('CelebrityScore'),\n                        BogusScore=data['NameInfoV2'].get('BogusScore'),\n                        GarbageScore=data['NameInfoV2'].get('GarbageScore'),\n                        FirstNameDictionaryScore=data['NameInfoV2'].get('FirstNameDictionaryScore'),\n                        MiddleNameDictionaryScore=data['NameInfoV2'].get('MiddleNameDictionaryScore'),\n                        LastNameDictionaryScore=data['NameInfoV2'].get('LastNameDictionaryScore'),\n                        OverallNameScore=data['NameInfoV2'].get('OverallNameScore'),\n                        IsNameGood=data['NameInfoV2'].get('IsNameGood'),\n                        StatusCodes=data['NameInfoV2'].get('StatusCodes'),\n                        Status=data['NameInfoV2'].get('Status')\n                    )\n\n                return NameInfoV2Response(\n                    NameInfoV2=name_info_v2,\n                    Error=error\n                )\n            except Exception as backup_exc:\n                raise RuntimeError(\"NV2 service unreachable on both endpoints\") from backup_exc\n        else:\n            raise RuntimeError(f\"NV2 trial error: {str(req_exc)}\") from req_exc\n\n\nfrom dataclasses import dataclass\nfrom typing import Optional\n\n@dataclass\nclass BestGuessName:\n    Prefix: Optional[str] = None\n    FirstName: Optional[str] = None\n    MiddleName: Optional[str] = None\n    LastName: Optional[str] = None\n    Suffix: Optional[str] = None\n\n    def __str__(self) -> str:\n        return (f\"Prefix: {self.Prefix}\\n\"\n                f\"FirstName: {self.FirstName}\\n\"\n                f\"MiddleName: {self.MiddleName}\\n\"\n                f\"LastName: {self.LastName}\\n\"\n                f\"Suffix: {self.Suffix}\")\n\n@dataclass\nclass NameInfoV2:\n    BestGuessName: Optional[BestGuessName] = None\n    NameIn: Optional[str] = None\n    NameClassification: Optional[str] = None\n    Prefix: Optional[str] = None\n    FirstName: Optional[str] = None\n    MiddleName: Optional[str] = None\n    LastName: Optional[str] = None\n    Suffix: Optional[str] = None\n    FirstNameFound: Optional[bool] = None\n    IsCommonFirstName: Optional[bool] = None\n    FirstNameOrigin: Optional[str] = None\n    FirstNameSimilar: Optional[str] = None\n    LastNameFound: Optional[bool] = None\n    IsCommonLastName: Optional[bool] = None\n    LastNameOrigin: Optional[str] = None\n    LastNameSimilar: Optional[str] = None\n    Gender: Optional[str] = None\n    FirstNameAlt: Optional[str] = None\n    MiddleNameAlt: Optional[str] = None\n    LastNameAlt: Optional[str] = None\n    FirstNameAltFound: Optional[bool] = None\n    LastNameAltFound: Optional[bool] = None\n    GenderAlt: Optional[str] = None\n    RelatedNames: Optional[str] = None\n    IsCorrectedName: Optional[bool] = None\n    IsBusinessName: Optional[bool] = None\n    BusinessName: Optional[str] = None\n    VulgarityScore: Optional[int] = None\n    CelebrityScore: Optional[int] = None\n    BogusScore: Optional[int] = None\n    GarbageScore: Optional[int] = None\n    FirstNameDictionaryScore: Optional[int] = None\n    MiddleNameDictionaryScore: Optional[int] = None\n    LastNameDictionaryScore: Optional[int] = None\n    OverallNameScore: Optional[int] = None\n    IsNameGood: Optional[str] = None\n    StatusCodes: Optional[str] = None\n    Status: Optional[str] = None\n\n    def __str__(self) -> str:\n        return (f\"{{BestGuessName: {self.BestGuessName.__str__() if self.BestGuessName else 'None'}\\n\"\n                f\"NameIn: {self.NameIn}\\n\"\n                f\"NameClassification: {self.NameClassification}\\n\"\n                f\"Prefix: {self.Prefix}\\n\"\n                f\"FirstName: {self.FirstName}\\n\"\n                f\"MiddleName: {self.MiddleName}\\n\"\n                f\"LastName: {self.LastName}\\n\"\n                f\"Suffix: {self.Suffix}\\n\"\n                f\"FirstNameFound: {self.FirstNameFound}\\n\"\n                f\"IsCommonFirstName: {self.IsCommonFirstName}\\n\"\n                f\"FirstNameOrigin: {self.FirstNameOrigin}\\n\"\n                f\"FirstNameSimilar: {self.FirstNameSimilar}\\n\"\n                f\"LastNameFound: {self.LastNameFound}\\n\"\n                f\"IsCommonLastName: {self.IsCommonLastName}\\n\"\n                f\"LastNameOrigin: {self.LastNameOrigin}\\n\"\n                f\"LastNameSimilar: {self.LastNameSimilar}\\n\"\n                f\"Gender: {self.Gender}\\n\"\n                f\"FirstNameAlt: {self.FirstNameAlt}\\n\"\n                f\"MiddleNameAlt: {self.MiddleNameAlt}\\n\"\n                f\"LastNameAlt: {self.LastNameAlt}\\n\"\n                f\"FirstNameAltFound: {self.FirstNameAltFound}\\n\"\n                f\"LastNameAltFound: {self.LastNameAltFound}\\n\"\n                f\"GenderAlt: {self.GenderAlt}\\n\"\n                f\"RelatedNames: {self.RelatedNames}\\n\"\n                f\"IsCorrectedName: {self.IsCorrectedName}\\n\"\n                f\"IsBusinessName: {self.IsBusinessName}\\n\"\n                f\"BusinessName: {self.BusinessName}\\n\"\n                f\"VulgarityScore: {self.VulgarityScore}\\n\"\n                f\"CelebrityScore: {self.CelebrityScore}\\n\"\n                f\"BogusScore: {self.BogusScore}\\n\"\n                f\"GarbageScore: {self.GarbageScore}\\n\"\n                f\"FirstNameDictionaryScore: {self.FirstNameDictionaryScore}\\n\"\n                f\"MiddleNameDictionaryScore: {self.MiddleNameDictionaryScore}\\n\"\n                f\"LastNameDictionaryScore: {self.LastNameDictionaryScore}\\n\"\n                f\"OverallNameScore: {self.OverallNameScore}\\n\"\n                f\"IsNameGood: {self.IsNameGood}\\n\"\n                f\"StatusCodes: {self.StatusCodes}\\n\"\n                f\"Status: {self.Status}\\n\")\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\"Type: {self.Type}\\n\"\n                f\"TypeCode: {self.TypeCode}\\n\"\n                f\"Desc: {self.Desc}\\n\"\n                f\"DescCode: {self.DescCode} \")\n\n@dataclass\nclass NameInfoV2Response:\n    NameInfoV2: Optional[NameInfoV2] = None\n    Error: Optional[Error] = None\n\n    def __str__(self) -> str:\n        name_info = str(self.NameInfoV2) if self.NameInfoV2 else \"None\"\n        error = str(self.Error) if self.Error else \"None\"\n        return (f\"NameInfoV2: {name_info}\\n\"\n                f\"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>Name Validation 2 NodeJS<\/strong><\/strong> <strong><strong>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 { NameInfoV2Response } from '.\/nv2_response.js';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the live ServiceObjects Name Validation 2 API service.\n *\/\nconst LiveBaseUrl = 'https:\/\/sws.serviceobjects.com\/NV2\/api.svc\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the backup ServiceObjects Name Validation 2 API service.\n *\/\nconst BackupBaseUrl = 'https:\/\/swsbackup.serviceobjects.com\/NV2\/api.svc\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the trial ServiceObjects Name Validation 2 API service.\n *\/\nconst TrialBaseUrl = 'https:\/\/trial.serviceobjects.com\/NV2\/api.svc\/';\n\n\/**\n * &lt;summary>\n * Checks if a response from the API is valid by verifying that it either has no Error object\n * or the Error.TypeCode is not equal to '3'.\n * &lt;\/summary>\n * &lt;param name=\"response\" type=\"Object\">The API response object to validate.&lt;\/param>\n * &lt;returns type=\"boolean\">True if the response is valid, false otherwise.&lt;\/returns>\n *\/\nconst isValid = (response) => !response?.Error || response.Error.TypeCode !== '3';\n\n\/**\n * &lt;summary>\n * Constructs a full URL for the NameInfoV2 API endpoint by combining the base URL\n * with query parameters derived from the input parameters.\n * &lt;\/summary>\n * &lt;param name=\"params\" type=\"Object\">An object containing all the input parameters.&lt;\/param>\n * &lt;param name=\"baseUrl\" type=\"string\">The base URL for the API service (live, backup, or trial).&lt;\/param>\n * &lt;returns type=\"string\">The constructed URL with query parameters.&lt;\/returns>\n *\/\nconst buildUrl = (params, baseUrl) =>\n    `${baseUrl}NameInfoV2?${querystring.stringify(params)}&amp;format=json`;\n\n\/**\n * &lt;summary>\n * Performs an HTTP GET request to the specified URL with a given timeout.\n * &lt;\/summary>\n * &lt;param name=\"url\" type=\"string\">The URL to send the GET request to.&lt;\/param>\n * &lt;param name=\"timeoutSeconds\" type=\"number\">The timeout duration in seconds for the request.&lt;\/param>\n * &lt;returns type=\"Promise&lt;NameInfoV2Response>\">A promise that resolves to a NameInfoV2Response object containing the API response data.&lt;\/returns>\n * &lt;exception cref=\"Error\">Thrown if the HTTP request fails, with a message detailing the error.&lt;\/exception>\n *\/\nconst httpGet = async (url, timeoutSeconds) => {\n    try {\n        const response = await axios.get(url, { timeout: timeoutSeconds * 1000 });\n        return new NameInfoV2Response(response.data);\n    } catch (error) {\n        throw new Error(`HTTP request failed: ${error.message}`);\n    }\n};\n\n\/**\n * &lt;summary>\n * Provides functionality to call the ServiceObjects Name Validation 2 API's NameInfoV2 endpoint,\n * retrieving name validation information with fallback to a backup endpoint for reliability in live mode.\n * &lt;\/summary>\n *\/\nconst NameInfoV2Client = {\n    \/**\n     * &lt;summary>\n     * Asynchronously invokes the NameInfoV2 API endpoint, attempting the primary endpoint\n     * first and falling back to the backup if the response is invalid (Error.TypeCode == '3') in live mode.\n     * &lt;\/summary>\n     * @param {string} Name - The name to validate.\n     * @param {string} Option - Comma-separated list of options for additional processing (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;NameInfoV2Response>} - A promise that resolves to a NameInfoV2Response object.\n     *\/\n    async invokeAsync(Name, Option = '', LicenseKey, isLive = true, timeoutSeconds = 15) {\n        const params = {\n            Name,\n            Option,\n            LicenseKey\n        };\n\n        const url = buildUrl(params, isLive ? LiveBaseUrl : TrialBaseUrl);\n        let response = await httpGet(url, timeoutSeconds);\n\n        if (isLive &amp;&amp; !isValid(response)) {\n            const fallbackUrl = buildUrl(params, BackupBaseUrl);\n            const fallbackResponse = await httpGet(fallbackUrl, timeoutSeconds);\n            return isValid(fallbackResponse) ? fallbackResponse : response;\n        }\n\n        return response;\n    },\n\n    \/**\n     * &lt;summary>\n     * Synchronously invokes the NameInfoV2 API endpoint by wrapping the async call\n     * and awaiting its result immediately.\n     * &lt;\/summary>\n     * @returns {NameInfoV2Response} - A NameInfoV2Response object with name validation details or an error.\n     *\/\n    invoke(Name, Option = '', LicenseKey, isLive = true, timeoutSeconds = 15) {\n        return (async () => await this.invokeAsync(\n            Name, Option, LicenseKey, isLive, timeoutSeconds\n        ))();\n    }\n};\n\nexport { NameInfoV2Client, NameInfoV2Response };\n\n\nclass BestGuessName {\n    constructor(data = {}) {\n        this.Prefix = data.Prefix;\n        this.FirstName = data.FirstName;\n        this.MiddleName = data.MiddleName;\n        this.LastName = data.LastName;\n        this.Suffix = data.Suffix;\n    }\n\n    toString() {\n        return `{Prefix: ${this.Prefix}\\n` +\n               `FirstName: ${this.FirstName}\\n` +\n               `MiddleName: ${this.MiddleName}\\n` +\n               `LastName: ${this.LastName}\\n` +\n               `Suffix: ${this.Suffix}}`;\n    }\n}\n\nclass NameInfoV2 {\n    constructor(data = {}) {\n        this.BestGuessName = data.BestGuessName ? new BestGuessName(data.BestGuessName) : \"\";\n        this.NameIn = data.NameIn;\n        this.NameClassification = data.NameClassification;\n        this.Prefix = data.Prefix;\n        this.FirstName = data.FirstName;\n        this.MiddleName = data.MiddleName;\n        this.LastName = data.LastName;\n        this.Suffix = data.Suffix;\n        this.FirstNameFound = data.FirstNameFound;\n        this.IsCommonFirstName = data.IsCommonFirstName;\n        this.FirstNameOrigin = data.FirstNameOrigin;\n        this.FirstNameSimilar = data.FirstNameSimilar;\n        this.LastNameFound = data.LastNameFound;\n        this.IsCommonLastName = data.IsCommonLastName;\n        this.LastNameOrigin = data.LastNameOrigin;\n        this.LastNameSimilar = data.LastNameSimilar;\n        this.Gender = data.Gender;\n        this.FirstNameAlt = data.FirstNameAlt;\n        this.MiddleNameAlt = data.MiddleNameAlt;\n        this.LastNameAlt = data.LastNameAlt;\n        this.FirstNameAltFound = data.FirstNameAltFound;\n        this.LastNameAltFound = data.LastNameAltFound;\n        this.GenderAlt = data.GenderAlt;\n        this.RelatedNames = data.RelatedNames;\n        this.IsCorrectedName = data.IsCorrectedName;\n        this.IsBusinessName = data.IsBusinessName;\n        this.BusinessName = data.BusinessName;\n        this.VulgarityScore = data.VulgarityScore;\n        this.CelebrityScore = data.CelebrityScore;\n        this.BogusScore = data.BogusScore;\n        this.GarbageScore = data.GarbageScore;\n        this.FirstNameDictionaryScore = data.FirstNameDictionaryScore;\n        this.MiddleNameDictionaryScore = data.MiddleNameDictionaryScore;\n        this.LastNameDictionaryScore = data.LastNameDictionaryScore;\n        this.OverallNameScore = data.OverallNameScore;\n        this.IsNameGood = data.IsNameGood;\n        this.StatusCodes = data.StatusCodes;\n        this.Status = data.Status;\n    }\n\n    toString() {\n        return `{BestGuessName: ${this.BestGuessName ? this.BestGuessName.toString() : 'null'}\\n` +\n               `NameIn: ${this.NameIn}\\n` +\n               `NameClassification: ${this.NameClassification}\\n` +\n               `Prefix: ${this.Prefix}\\n` +\n               `FirstName: ${this.FirstName}\\n` +\n               `MiddleName: ${this.MiddleName}\\n` +\n               `LastName: ${this.LastName}\\n` +\n               `Suffix: ${this.Suffix}\\n` +\n               `FirstNameFound: ${this.FirstNameFound}\\n` +\n               `IsCommonFirstName: ${this.IsCommonFirstName}\\n` +\n               `FirstNameOrigin: ${this.FirstNameOrigin}\\n` +\n               `FirstNameSimilar: ${this.FirstNameSimilar}\\n` +\n               `LastNameFound: ${this.LastNameFound}\\n` +\n               `IsCommonLastName: ${this.IsCommonLastName}\\n` +\n               `LastNameOrigin: ${this.LastNameOrigin}\\n` +\n               `LastNameSimilar: ${this.LastNameSimilar}\\n` +\n               `Gender: ${this.Gender}\\n` +\n               `FirstNameAlt: ${this.FirstNameAlt}\\n` +\n               `MiddleNameAlt: ${this.MiddleNameAlt}\\n` +\n               `LastNameAlt: ${this.LastNameAlt}\\n` +\n               `FirstNameAltFound: ${this.FirstNameAltFound}\\n` +\n               `LastNameAltFound: ${this.LastNameAltFound}\\n` +\n               `GenderAlt: ${this.GenderAlt}\\n` +\n               `RelatedNames: ${this.RelatedNames}\\n` +\n               `IsCorrectedName: ${this.IsCorrectedName}\\n` +\n               `IsBusinessName: ${this.IsBusinessName}\\n` +\n               `BusinessName: ${this.BusinessName}\\n` +\n               `VulgarityScore: ${this.VulgarityScore}\\n` +\n               `CelebrityScore: ${this.CelebrityScore}\\n` +\n               `BogusScore: ${this.BogusScore}\\n` +\n               `GarbageScore: ${this.GarbageScore}\\n` +\n               `FirstNameDictionaryScore: ${this.FirstNameDictionaryScore}\\n` +\n               `MiddleNameDictionaryScore: ${this.MiddleNameDictionaryScore}\\n` +\n               `LastNameDictionaryScore: ${this.LastNameDictionaryScore}\\n` +\n               `OverallNameScore: ${this.OverallNameScore}\\n` +\n               `IsNameGood: ${this.IsNameGood}\\n` +\n               `StatusCodes: ${this.StatusCodes}\\n` +\n               `Status: ${this.Status}\\n`;\n    }\n}\n\nclass Error {\n    constructor(data = {}) {\n        this.Type = data.Type;\n        this.TypeCode = data.TypeCode;\n        this.Desc = data.Desc;\n        this.DescCode = data.DescCode;\n    }\n\n    toString() {\n        return `Type: ${this.Type}\\n` +\n               `TypeCode: ${this.TypeCode}\\n` +\n               `Desc: ${this.Desc}\\n` +\n               `DescCode: ${this.DescCode} `;\n    }\n}\n\nclass NameInfoV2Response {\n    constructor(data = {}) {\n        this.NameInfoV2 = data.NameInfoV2 ? new NameInfoV2(data.NameInfoV2) : null;\n        this.Error = data.Error ? new Error(data.Error) : null;\n    }\n\n    toString() {\n        return `NameInfoV2: ${(this.NameInfoV2 ? this.NameInfoV2.toString() : 'null')}\\n` +\n               `Error: ${this.Error ? this.Error.toString() : 'null'}`;\n    }\n}\n\nexport{ NameInfoV2Response };<\/pre>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":5669,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5675","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>NV2 - REST<\/title>\n<meta name=\"description\" content=\"C#PythonNodeJS Name Validation 2 C# Code Snippet \ufeff namespace name_validation_2_dot_net.REST { \/\/\/ &lt;summary&gt; \/\/\/ Provides functionality to call the\" \/>\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-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NV2 - REST\" \/>\n<meta property=\"og:description\" content=\"C#PythonNodeJS Name Validation 2 C# Code Snippet \ufeff namespace name_validation_2_dot_net.REST { \/\/\/ &lt;summary&gt; \/\/\/ Provides functionality to call the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-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-26T20:16:28+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-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/\",\"name\":\"NV2 - REST\",\"isPartOf\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#website\"},\"datePublished\":\"2022-11-14T23:17:03+00:00\",\"dateModified\":\"2025-09-26T20:16:28+00:00\",\"description\":\"C#PythonNodeJS Name Validation 2 C# Code Snippet \ufeff namespace name_validation_2_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides functionality to call the\",\"breadcrumb\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DOTS Name Validation 2\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"NV2 &#8211; Code Snippets and Sample Code\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"NV2 &#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":"NV2 - REST","description":"C#PythonNodeJS Name Validation 2 C# Code Snippet \ufeff namespace name_validation_2_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides functionality to call the","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-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/","og_locale":"en_US","og_type":"article","og_title":"NV2 - REST","og_description":"C#PythonNodeJS Name Validation 2 C# Code Snippet \ufeff namespace name_validation_2_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides functionality to call the","og_url":"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/","og_site_name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","article_modified_time":"2025-09-26T20:16:28+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-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/","url":"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/","name":"NV2 - REST","isPartOf":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#website"},"datePublished":"2022-11-14T23:17:03+00:00","dateModified":"2025-09-26T20:16:28+00:00","description":"C#PythonNodeJS Name Validation 2 C# Code Snippet \ufeff namespace name_validation_2_dot_net.REST { \/\/\/ &lt;summary> \/\/\/ Provides functionality to call the","breadcrumb":{"@id":"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/nv2-rest\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.serviceobjects.com\/docs\/"},{"@type":"ListItem","position":2,"name":"DOTS Name Validation 2","item":"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/"},{"@type":"ListItem","position":3,"name":"NV2 &#8211; Code Snippets and Sample Code","item":"https:\/\/www.serviceobjects.com\/docs\/dots-name-validation-2\/nv2-code-snippets-and-sample-code\/"},{"@type":"ListItem","position":4,"name":"NV2 &#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\/5675","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/comments?post=5675"}],"version-history":[{"count":18,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/5675\/revisions"}],"predecessor-version":[{"id":12335,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/5675\/revisions\/12335"}],"up":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/5669"}],"wp:attachment":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/media?parent=5675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}