{"id":9346,"date":"2023-06-05T11:22:16","date_gmt":"2023-06-05T18:22:16","guid":{"rendered":"https:\/\/www.serviceobjects.com\/docs\/?page_id=9346"},"modified":"2025-09-26T15:15:23","modified_gmt":"2025-09-26T22:15:23","slug":"pvi-rest","status":"publish","type":"page","link":"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/","title":{"rendered":"PVI &#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>Phone Validation International 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.Text.Json;\nusing System.Web;\n\nnamespace phone_validation_international_dot_net.REST\n{\n    \/\/\/ &lt;summary>\n    \/\/\/ Provides functionality to call the ServiceObjects Phone Validation International (PVI) REST API's GetPhoneDetails endpoint,\n    \/\/\/ retrieving comprehensive carrier and exchange information for a given phone number with fallback to a backup endpoint for reliability in live mode.\n    \/\/\/ &lt;\/summary>\n    public class GetPhoneDetailsClient\n    {\n        \/\/ Base URL constants: production, backup, and trial\n        private const string LiveBaseUrl = \"https:\/\/sws.serviceobjects.com\/PVI\/\";\n        private const string BackupBaseUrl = \"https:\/\/swsbackup.serviceobjects.com\/PVI\/\";\n        private const string TrialBaseUrl = \"https:\/\/trial.serviceobjects.com\/PVI\/\";\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Synchronously calls the GetPhoneDetails REST endpoint to retrieve phone details,\n        \/\/\/ attempting the primary endpoint first and falling back to the backup if the response is invalid\n        \/\/\/ (Error.Status == \"500\") in live mode.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"input\">The input parameters including phone number, country, options, and authentication ID.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"PVIResponse\"\/> containing phone details or an error.&lt;\/returns>\n        public static PVIResponseWrapper Invoke(GetPhoneDetailsInput input)\n        {\n            \/\/ Use query string parameters so missing\/optional fields don't break the URL\n            string url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            string jsonResponse = Helper.HttpGet(url, input.TimeoutSeconds);\n            bool IsValid = true;\n            PVIResponseWrapper 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.PhoneDetails = JsonSerializer.Deserialize&lt;PhoneDetails>(jsonResponse, options);\n            }\n\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.PhoneDetails = JsonSerializer.Deserialize&lt;PhoneDetails>(jsonResponse, options);\n                }\n                return response;\n            }\n            return response;\n        }\n\n        \/\/\/ &lt;summary>\n        \/\/\/ Asynchronously calls the GetPhoneDetails REST endpoint to retrieve phone details,\n        \/\/\/ attempting the primary endpoint first and falling back to the backup if the response is invalid\n        \/\/\/ (Error.Status == \"500\") in live mode.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"input\">The input parameters including phone number, country, options, and authentication ID.&lt;\/param>\n        \/\/\/ &lt;returns>Deserialized &lt;see cref=\"PVIResponse\"\/> containing phone details or an error.&lt;\/returns>\n        public static async Task&lt;PVIResponseWrapper> InvokeAsync(GetPhoneDetailsInput input)\n        {\n            \/\/ Use query string parameters so missing\/optional fields don't break the URL\n            string url = BuildUrl(input, input.IsLive ? LiveBaseUrl : TrialBaseUrl);\n            string jsonResponse = await Helper.HttpGetAsync(url, input.TimeoutSeconds).ConfigureAwait(false);\n            bool IsValid = true;\n            PVIResponseWrapper 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.PhoneDetails = JsonSerializer.Deserialize&lt;PhoneDetails>(jsonResponse, options);\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.PhoneDetails = JsonSerializer.Deserialize&lt;PhoneDetails>(jsonResponse, options);\n                }\n                return response;\n            }\n\n            return response;\n        }\n\n        \/\/ Build the full request URL, including URL-encoded query string\n        public static string BuildUrl(GetPhoneDetailsInput input, string baseUrl)\n        {\n            \/\/ Construct query string with URL-encoded parameters\n            string qs = $\"GetPhoneDetails?\" +\n                        $\"Phone={Helper.UrlEncode(input.Phone)}\" +\n                        $\"&amp;Country={Helper.UrlEncode(input.Country)}\" +\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 GetPhoneDetails API call. Represents a phone number to retrieve details for.\n        \/\/\/ &lt;\/summary>\n        \/\/\/ &lt;param name=\"Phone\">The phone number to validate (variable digit length).&lt;\/param>\n        \/\/\/ &lt;param name=\"Country\">The location of the phone number (1-3 digit Country Calling Code, ISO2, ISO3, or Country Name).&lt;\/param>\n        \/\/\/ &lt;param name=\"Options\">Comma-separated list of optional parameters. Optional.&lt;\/param>\n        \/\/\/ &lt;param name=\"AuthID\">The authentication ID provided by Service Objects.&lt;\/param>\n        \/\/\/ &lt;param name=\"IsLive\">Indicates whether to use the live service (true) or trial service (false).&lt;\/param>\n        \/\/\/ &lt;param name=\"TimeoutSeconds\">Timeout duration for the API call, in seconds.&lt;\/param>\n        public record GetPhoneDetailsInput(\n            string Phone = \"\",\n            string Country = \"\",\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 phone_validation_international_dot_net.REST\n{\n    public class PVIResponseWrapper\n    {\n        public PhoneDetails? PhoneDetails;\n        public ProblemDetails? ProblemDetails;\n        public PVIResponseWrapper() { }\n    }\n}\n\n\n\ufeffusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Net.Http;\nusing System.Reflection;\nusing System.Text;\nusing System.Text.Json;\nusing System.Threading.Tasks;\nusing System.Web;\n\nnamespace phone_validation_international_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><strong>Phone Validation International<\/strong> Python Rest Code Snippet<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from pvi_response import PVIResponse, TimeZone, ProblemDetails, ServiceProvider\nimport requests\nimport json\n\n# Endpoint URLs for ServiceObjects Phone Validation International (PVI) API\nprimary_url = \"https:\/\/sws.serviceobjects.com\/PVI\/GetPhoneDetails?\"\nbackup_url = \"https:\/\/swsbackup.serviceobjects.com\/PVI\/GetPhoneDetails?\"\ntrial_url = \"https:\/\/trial.serviceobjects.com\/PVI\/GetPhoneDetails?\"\n\ndef get_phone_details(\n    phone: str,\n    country: str = \"\",\n    options: str = \"\",\n    auth_id: str = \"\",\n    is_live: bool = True,\n    timeout_seconds: int = 15\n) -> PVIResponse:\n    \"\"\"\n    Calls the ServiceObjects Phone Validation International (PVI) API's GetPhoneDetails endpoint\n    to retrieve phone details (e.g., carrier, line type, time zones) for a given phone number.\n    Validates input parameters and returns a ProblemDetails response if invalid. Uses a backup endpoint for reliability in live mode.\n\n    Args:\n        phone (str): The phone number to validate (e.g., \"+12025550123\").\n        country (str, optional): The country code or name (e.g., \"US\"). Optional.\n        options (str, optional): Optional. Reserved for future use.\n        auth_id (str): Required. Authentication ID provided by Service Objects.\n        is_live (bool, optional): Option to use live service (true) or trial service (false). Defaults to True.\n        timeout_seconds (int, optional): Timeout in seconds for the HTTP request. Defaults to 15.\n\n    Returns:\n        PVIResponse: Parsed JSON response with phone details or a ProblemDetails if validation fails or the API call fails.\n\n    Raises:\n        RuntimeError: If the API returns an error payload with status \"500\".\n        requests.RequestException: On network\/HTTP failures (trial mode).\n    \"\"\"\n    params = {\n        \"Phone\": phone,\n        \"Country\": country,\n        \"Options\": options,\n        \"AuthID\": auth_id\n    }\n\n    url = primary_url if is_live else trial_url\n\n    try:\n        # Attempt primary (or trial) endpoint\n        response = requests.get(url, params=params, timeout=timeout_seconds)\n        response.raise_for_status()\n        data = response.json()\n\n        # If API returned an error in JSON payload, trigger fallback\n        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 PVIResponse(ProblemDetails=ProblemDetails(**problem_details))\n            else:\n                # Trial mode error is terminal\n                return PVIResponse(ProblemDetails=ProblemDetails(**problem_details))\n\n        # Convert JSON response to PVIResponse for structured access\n        #problem_details = ProblemDetails(**data.get(\"ProblemDetails\", {})) if data.get(\"ProblemDetails\") else None\n\n        return PVIResponse(\n            Score=data.get(\"score\"),\n            PhoneIn=data.get(\"phoneIn\"),\n            CountryCode=data.get(\"countryCode\"),\n            FormatNational=data.get(\"formatNational\"),\n            FormatInternational=data.get(\"formatInternational\"),\n            FormatE164=data.get(\"formatE164\"),\n            Extension=data.get(\"extension\"),\n            Locality=data.get(\"locality\"),\n            AdminArea=data.get(\"adminArea\"),\n            AdminAreaAbbr=data.get(\"adminAreaAbbr\"),\n            Country=data.get(\"country\"),\n            CountryISO2=data.get(\"countryISO2\"),\n            CountryISO3=data.get(\"countryISO3\"),\n            Latitude=data.get(\"latitude\"),\n            Longitude=data.get(\"longitude\"),\n            LatLongMatchLevel=data.get(\"latLongMatchLevel\"),\n            TimeZones=[\n                TimeZone(\n                    ZoneName=zone.get(\"zoneName\"),\n                    ZoneAbbr=zone.get(\"zoneAbbr\"),\n                    CountryISO3=zone.get(\"countryISO3\"),\n                    UtcOffset=zone.get(\"utcOffset\")\n                )\n                for zone in data.get(\"timeZones\", [])\n            ] if \"timeZones\" in data else [],\n            LineType=data.get(\"lineType\"),\n            SmsAddress=data.get(\"smsAddress\"),\n            ValidPhone=data.get(\"validPhone\"),\n            ValidPhoneLength=data.get(\"validPhoneLength\"),\n            Notes=data.get(\"notes\", []),\n            Warnings=data.get(\"warnings\", []),\n            CurrentProvider=ServiceProvider(\n                ProviderID=data.get(\"currentProvider\", {}).get(\"providerID\"),\n                ProviderName=data.get(\"currentProvider\", {}).get(\"providerName\"),\n                CountryISO3=data.get(\"currentProvider\", {}).get(\"countryISO3\")\n            ) if data.get(\"currentProvider\") else None,\n            PreviousProvider=ServiceProvider(\n                ProviderID=data.get(\"previousProvider\", {}).get(\"providerID\"),\n                ProviderName=data.get(\"previousProvider\", {}).get(\"providerName\"),\n                CountryISO3=data.get(\"previousProvider\", {}).get(\"countryISO3\")\n            ) if data.get(\"previousProvider\") else None,\n            OriginalProvider=ServiceProvider(\n                ProviderID=data.get(\"originalProvider\", {}).get(\"providerID\"),\n                ProviderName=data.get(\"originalProvider\", {}).get(\"providerName\"),\n                CountryISO3=data.get(\"originalProvider\", {}).get(\"countryISO3\")\n            ) if data.get(\"originalProvider\") else None,\n            LastPortedDate=data.get(\"lastPortedDate\")\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 PVIResponse(ProblemDetails=ProblemDetails(**problem_details))\n\n                #problem_details = ProblemDetails(**data.get(\"ProblemDetails\", {})) if data.get(\"ProblemDetails\") else None\n\n                return PVIResponse(\n                    Score=data.get(\"score\"),\n                    PhoneIn=data.get(\"phoneIn\"),\n                    CountryCode=data.get(\"countryCode\"),\n                    FormatNational=data.get(\"formatNational\"),\n                    FormatInternational=data.get(\"formatInternational\"),\n                    FormatE164=data.get(\"formatE164\"),\n                    Extension=data.get(\"extension\"),\n                    Locality=data.get(\"locality\"),\n                    AdminArea=data.get(\"adminArea\"),\n                    AdminAreaAbbr=data.get(\"adminAreaAbbr\"),\n                    Country=data.get(\"country\"),\n                    CountryISO2=data.get(\"countryISO2\"),\n                    CountryISO3=data.get(\"countryISO3\"),\n                    Latitude=data.get(\"latitude\"),\n                    Longitude=data.get(\"longitude\"),\n                    LatLongMatchLevel=data.get(\"latLongMatchLevel\"),\n                    TimeZones=[\n                        TimeZone(\n                            ZoneName=zone.get(\"zoneName\"),\n                            ZoneAbbr=zone.get(\"zoneAbbr\"),\n                            CountryISO3=zone.get(\"countryISO3\"),\n                            UtcOffset=zone.get(\"utcOffset\")\n                        )\n                        for zone in data.get(\"timeZones\", [])\n                    ] if \"timeZones\" in data else [],\n                    LineType=data.get(\"lineType\"),\n                    SmsAddress=data.get(\"smsAddress\"),\n                    ValidPhone=data.get(\"validPhone\"),\n                    ValidPhoneLength=data.get(\"validPhoneLength\"),\n                    Notes=data.get(\"notes\", []),\n                    Warnings=data.get(\"warnings\", []),\n                    CurrentProvider=ServiceProvider(\n                        ProviderID=data.get(\"currentProvider\", {}).get(\"providerID\"),\n                        ProviderName=data.get(\"currentProvider\", {}).get(\"providerName\"),\n                        CountryISO3=data.get(\"currentProvider\", {}).get(\"countryISO3\")\n                    ) if data.get(\"currentProvider\") else None,\n                    PreviousProvider=ServiceProvider(\n                        ProviderID=data.get(\"previousProvider\", {}).get(\"providerID\"),\n                        ProviderName=data.get(\"previousProvider\", {}).get(\"providerName\"),\n                        CountryISO3=data.get(\"previousProvider\", {}).get(\"countryISO3\")\n                    ) if data.get(\"previousProvider\") else None,\n                    OriginalProvider=ServiceProvider(\n                        ProviderID=data.get(\"originalProvider\", {}).get(\"providerID\"),\n                        ProviderName=data.get(\"originalProvider\", {}).get(\"providerName\"),\n                        CountryISO3=data.get(\"originalProvider\", {}).get(\"countryISO3\")\n                    ) if data.get(\"originalProvider\") else None,\n                    LastPortedDate=data.get(\"lastPortedDate\")\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 PVIResponse(\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 PVIResponse(\n                ProblemDetails=problem_details\n            )\n\n\n\"\"\"\nResponse classes for Phone Validation International (PVI) API.\n\"\"\"\n\nfrom dataclasses import dataclass\nfrom typing import Optional, List\n\n@dataclass\nclass TimeZone:\n    ZoneName: Optional[str] = None\n    ZoneAbbr: Optional[str] = None\n    CountryISO3: Optional[str] = None\n    UtcOffset: Optional[str] = None\n\n    def __str__(self) -> str:\n\n        return (f\"TimeZone: ZoneName={self.ZoneName}, ZoneAbbr={self.ZoneAbbr}, \"\n                f\"CountryISO3={self.CountryISO3}, UtcOffset={self.UtcOffset}\")\n\n@dataclass\nclass ServiceProvider:\n    ProviderID: Optional[str] = None\n    ProviderName: Optional[str] = None\n    CountryISO3: Optional[str] = None\n\n    def __str__(self) -> str:\n       \n        return (f\"ServiceProvider: ProviderID={self.ProviderID}, ProviderName={self.ProviderName}, \"\n                f\"CountryISO3={self.CountryISO3}\")\n\n@dataclass\nclass ProblemDetails:\n    Type: Optional[str] = None\n    Title: Optional[str] = None\n    Status: Optional[str] = None\n    Detail: Optional[str] = None\n\n    def __str__(self) -> str:\n       \n        return (f\"ProblemDetails: Type={self.Type}, Title={self.Title}, \"\n                f\"Status={self.Status}, Detail={self.Detail}\")\n\n@dataclass\nclass PVIResponse:\n    Score: Optional[str] = None\n    PhoneIn: Optional[str] = None\n    CountryCode: Optional[str] = None\n    FormatNational: Optional[str] = None\n    FormatInternational: Optional[str] = None\n    FormatE164: Optional[str] = None\n    Extension: Optional[str] = None\n    Locality: Optional[str] = None\n    AdminArea: Optional[str] = None\n    AdminAreaAbbr: Optional[str] = None\n    Country: Optional[str] = None\n    CountryISO2: Optional[str] = None\n    CountryISO3: Optional[str] = None\n    Latitude: Optional[float] = None\n    Longitude: Optional[float] = None\n    LatLongMatchLevel: Optional[str] = None\n    TimeZones: Optional[List['TimeZone']] = None\n    LineType: Optional[str] = None\n    SmsAddress: Optional[str] = None\n    ValidPhone: Optional[bool] = None\n    ValidPhoneLength: Optional[bool] = None\n    Notes: Optional[List[str]] = None\n    Warnings: Optional[List[str]] = None\n    CurrentProvider: Optional['ServiceProvider'] = None\n    PreviousProvider: Optional['ServiceProvider'] = None\n    OriginalProvider: Optional['ServiceProvider'] = None\n    LastPortedDate: Optional[str] = None\n    ProblemDetails: Optional['ProblemDetails'] = None\n\n    def __post_init__(self):\n        if self.TimeZones is None:\n            self.TimeZones = []\n        if self.Notes is None:\n            self.Notes = []\n        if self.Warnings is None:\n            self.Warnings = []\n\n    def __str__(self) -> str:\n        \"\"\"\n        Convert the phone details response to a string representation.\n        \"\"\"\n        time_zones_string = ', '.join(str(zone) for zone in self.TimeZones) if self.TimeZones else 'None'\n        notes_string = f\"[{', '.join(self.Notes)}]\" if self.Notes else 'None'\n        warnings_string = f\"[{', '.join(self.Warnings)}]\" if self.Warnings else 'None'\n        current_provider = str(self.CurrentProvider) if self.CurrentProvider else 'None'\n        previous_provider = str(self.PreviousProvider) if self.PreviousProvider else 'None'\n        original_provider = str(self.OriginalProvider) if self.OriginalProvider else 'None'\n        problem_details = str(self.ProblemDetails) if self.ProblemDetails else 'None'\n        return (f\"PVIResponse: Score={self.Score}, PhoneIn={self.PhoneIn}, CountryCode={self.CountryCode}, \"\n                f\"FormatNational={self.FormatNational}, FormatInternational={self.FormatInternational}, \"\n                f\"FormatE164={self.FormatE164}, Extension={self.Extension}, Locality={self.Locality}, \"\n                f\"AdminArea={self.AdminArea}, AdminAreaAbbr={self.AdminAreaAbbr}, Country={self.Country}, \"\n                f\"CountryISO2={self.CountryISO2}, CountryISO3={self.CountryISO3}, Latitude={self.Latitude}, \"\n                f\"Longitude={self.Longitude}, LatLongMatchLevel={self.LatLongMatchLevel}, \"\n                f\"LineType={self.LineType}, SmsAddress={self.SmsAddress}, ValidPhone={self.ValidPhone}, \"\n                f\"ValidPhoneLength={self.ValidPhoneLength}, LastPortedDate={self.LastPortedDate}, \"\n                f\"TimeZones=[{time_zones_string}], Notes={notes_string}, Warnings={warnings_string}, \"\n                f\"CurrentProvider={current_provider}, PreviousProvider={previous_provider}, \"\n                f\"OriginalProvider={original_provider}, ProblemDetails={problem_details}\")<\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong><strong><strong>Phone Validation International<\/strong> NodeJS Rest 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 { PVIResponse } from '.\/pvi_response.js';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the live ServiceObjects Phone Validation International (PVI) API service.\n *\/\nconst LiveBaseUrl = 'https:\/\/sws.serviceobjects.com\/PVI\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the backup ServiceObjects Phone Validation International (PVI) API service.\n *\/\nconst BackupBaseUrl = 'https:\/\/swsbackup.serviceobjects.com\/PVI\/';\n\n\/**\n * @constant\n * @type {string}\n * @description The base URL for the trial ServiceObjects Phone Validation International (PVI) API service.\n *\/\nconst TrialBaseUrl = 'https:\/\/trial.serviceobjects.com\/PVI\/';\n\n\/**\n * Checks if a response from the API is valid by verifying that it either has no ProblemDetails object\n * or the ProblemDetails.Status is not equal to 500.\n * @param {PVIResponse} 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 GetPhoneDetails 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}GetPhoneDetails?${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;PVIResponse>} A promise that resolves to a PVIResponse 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 PVIResponse();\n    try {\n        const response = await axios.get(url, { timeout: timeoutSeconds * 1000 });\n\n        if (response.status === 200) {\n            result.Score = response.data.score ?? null;\n            result.PhoneIn = response.data.phoneIn ?? null;\n            result.CountryCode = response.data.countryCode ?? null;\n            result.FormatNational = response.data.formatNational ?? null;\n            result.FormatInternational = response.data.formatInternational ?? null;\n            result.FormatE164 = response.data.formatE164 ?? null;\n            result.Extension = response.data.extension ?? null;\n            result.Locality = response.data.locality ?? null;\n            result.AdminArea = response.data.adminArea ?? null;\n            result.AdminAreaAbbr = response.data.adminAreaAbbr ?? null;\n            result.Country = response.data.country ?? null;\n            result.CountryISO2 = response.data.countryISO2 ?? null;\n            result.CountryISO3 = response.data.countryISO3 ?? null;\n            result.Latitude = response.data.latitude ?? null;\n            result.Longitude = response.data.longitude ?? null;\n            result.LatLongMatchLevel = response.data.latLongMatchLevel ?? null;\n            result.TimeZones = response.data.timeZones ??  [];\n            result.LineType = response.data.lineType ?? null;\n            result.SmsAddress = response.data.smsAddress ?? null;\n            result.ValidPhone = response.data.validPhone ?? null;\n            result.ValidPhoneLength = response.data.validPhoneLength ?? null;\n            result.Notes = response.data.notes ?? null;\n            result.Warnings = response.data.warnings ?? null;\n            result.CurrentProvider = response.data.currentProvider ?? null;\n            result.PreviousProvider = response.data.previousProvider ?? null;\n            result.OriginalProvider = response.data.originalProvider ?? null;\n            result.LastPortedDate = response.data.lastPortedDate ?? 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.Score = null;\n            result.PhoneIn = null;\n            result.CountryCode = null;\n            result.FormatNational = null;\n            result.FormatInternational = null;\n            result.FormatE164 = null;\n            result.Extension = null;\n            result.Locality = null;\n            result.AdminArea = null;\n            result.AdminAreaAbbr = null;\n            result.Country = null;\n            result.CountryISO2 = null;\n            result.CountryISO3 = null;\n            result.Latitude = null;\n            result.Longitude = null;\n            result.LatLongMatchLevel = null;\n            result.TimeZones = [];\n            result.LineType = null;\n            result.SmsAddress = null;\n            result.ValidPhone = null;\n            result.ValidPhoneLength = null;\n            result.Notes = null;\n            result.Warnings = null;\n            result.CurrentProvider = null;\n            result.PreviousProvider = null;\n            result.OriginalProvider = null;\n            result.LastPortedDate = 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.Score = null;\n        result.PhoneIn = null;\n        result.CountryCode = null;\n        result.FormatNational = null;\n        result.FormatInternational = null;\n        result.FormatE164 = null;\n        result.Extension = null;\n        result.Locality = null;\n        result.AdminArea = null;\n        result.AdminAreaAbbr = null;\n        result.Country = null;\n        result.CountryISO2 = null;\n        result.CountryISO3 = null;\n        result.Latitude = null;\n        result.Longitude = null;\n        result.LatLongMatchLevel = null;\n        result.TimeZones = [];\n        result.LineType = null;\n        result.SmsAddress = null;\n        result.ValidPhone = null;\n        result.ValidPhoneLength = null;\n        result.Notes = null;\n        result.Warnings = null;\n        result.CurrentProvider = null;\n        result.PreviousProvider = null;\n        result.OriginalProvider = null;\n        result.LastPortedDate = null;\n    }\n    return result;\n};\n\n\/**\n * Provides functionality to call the ServiceObjects Phone Validation International (PVI) API's GetPhoneDetails endpoint,\n * retrieving phone details (e.g., carrier, line type, time zones) for a given phone number\n * with fallback to a backup endpoint for reliability in live mode.\n *\/\nconst GetPhoneDetailsClient = {\n    \/**\n     * Asynchronously invokes the GetPhoneDetails API endpoint, attempting the primary endpoint\n     * first and falling back to the backup if the response is invalid (ProblemDetails.Status == 500) in live mode.\n     * @param {string} Phone - The phone number to validate (e.g., \"+12025550123\").\n     * @param {string} [Country] - The country code or name (e.g., \"US\"). Optional.\n     * @param {string} [Options] - Optional. Reserved for future use.\n     * @param {string} AuthID - Your license key to use the service.\n     * @param {boolean} [isLive=true] - Value to determine whether to use the live or trial servers.\n     * @param {number} [timeoutSeconds=15] - Timeout, in seconds, for the call to the service.\n     * @returns {Promise&lt;PVIResponse>} A promise that resolves to a PVIResponse object.\n     *\/\n    async invokeAsync(Phone, Country, Options, AuthID, isLive = true, timeoutSeconds = 15) {\n        const params = {\n            Phone,\n            Country,\n            Options,\n            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        return response;\n    },\n\n    \/**\n     * Synchronously invokes the GetPhoneDetails 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} Phone - The phone number to validate (e.g., \"+12025550123\").\n     * @param {string} [Country] - The country code or name (e.g., \"US\"). Optional.\n     * @param {string} [Options] - Optional. Reserved for future use.\n     * @param {string} AuthID - Your license key to use the service.\n     * @param {boolean} [isLive=true] - Value to determine whether to use the live or trial servers.\n     * @param {number} [timeoutSeconds=15] - Timeout, in seconds, for the call to the service.\n     * @returns {PVIResponse} A PVIResponse object with phone details or an error.\n     *\/\n    invoke(Phone, Country, Options, AuthID, isLive = true, timeoutSeconds = 15) {\n        return (async () => await this.invokeAsync(\n            Phone, Country, Options, AuthID, isLive, timeoutSeconds\n        ))();\n    }\n};\n\nexport { GetPhoneDetailsClient, PVIResponse };\n\n\n\/**\n * Phone details response component for PVI API.\n *\/\nexport class PVIResponse {\n  constructor(data = {}) {\n    this.Score = data.score;\n    this.PhoneIn = data.phoneIn;\n    this.CountryCode = data.countryCode;\n    this.FormatNational = data.formatNational;\n    this.FormatInternational = data.formatInternational;\n    this.FormatE164 = data.formatE164;\n    this.Extension = data.extension;\n    this.Locality = data.locality;\n    this.AdminArea = data.adminArea;\n    this.AdminAreaAbbr = data.adminAreaAbbr;\n    this.Country = data.country;\n    this.CountryISO2 = data.countryISO2;\n    this.CountryISO3 = data.countryISO3;\n    this.Latitude = data.latitude;\n    this.Longitude = data.longitude;\n    this.LatLongMatchLevel = data.latLongMatchLevel;\n    this.TimeZones = (data.timeZones || []).map(zone => new TimeZone(zone));\n    this.LineType = data.lineType;\n    this.SmsAddress = data.smsAddress;\n    this.ValidPhone = data.validPhone;\n    this.ValidPhoneLength = data.validPhoneLength;\n    this.Notes = data.notes;\n    this.Warnings = data.warnings;\n    this.CurrentProvider = data.currentProvider;\n    this.PreviousProvider = data.previousProvider;\n    this.OriginalProvider = data.originalProvider;\n    this.LastPortedDate = data.lastPortedDate;\n  }\n\n  toString() {\n    const timeZonesString = this.TimeZones.length\n      ? this.TimeZones.map(zone => zone.toString()).join(\", \")\n      : \"null\";\n    const notesString = this.Notes ? `[${this.Notes.join(\", \")}]` : \"null\";\n    const warningsString = this.Warnings ? `[${this.Warnings.join(\", \")}]` : \"null\";\n    return `Score: ${this.Score}, PhoneIn: ${this.PhoneIn}, CountryCode: ${this.CountryCode}, FormatNational: ${this.FormatNational}, ` +\n      `FormatInternational: ${this.FormatInternational}, FormatE164: ${this.FormatE164}, Extension: ${this.Extension}, ` +\n      `Locality: ${this.Locality}, AdminArea: ${this.AdminArea}, AdminAreaAbbr: ${this.AdminAreaAbbr}, ` +\n      `Country: ${this.Country}, CountryISO2: ${this.CountryISO2}, CountryISO3: ${this.CountryISO3}, ` +\n      `Latitude: ${this.Latitude}, Longitude: ${this.Longitude}, LatLongMatchLevel: ${this.LatLongMatchLevel}, ` +\n      `LineType: ${this.LineType}, SmsAddress: ${this.SmsAddress}, ValidPhone: ${this.ValidPhone}, ` +\n      `ValidPhoneLength: ${this.ValidPhoneLength}, LastPortedDate: ${this.LastPortedDate}, ` +\n      `TimeZones: [${timeZonesString}], Notes: ${notesString}, Warnings: ${warningsString}, ` +\n      `CurrentProvider: ${this.CurrentProvider ? this.CurrentProvider.toString() : \"null\"}, ` +\n      `PreviousProvider: ${this.PreviousProvider ? this.PreviousProvider.toString() : \"null\"}, ` +\n      `OriginalProvider: ${this.OriginalProvider ? this.OriginalProvider.toString() : \"null\"}`;\n  }\n}\n\n\/**\n * Problem details component for PVI API errors.\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\n\/**\n * Time zone information for a phone number.\n *\/\nexport class TimeZone {\n  constructor(data = {}) {\n    this.ZoneName = data.zoneName;\n    this.ZoneAbbr = data.zoneAbbr;\n    this.CountryISO3 = data.countryISO3;\n    this.UtcOffset = data.utcOffset;\n  }\n\n  toString() {\n    return `ZoneName: ${this.ZoneName}, ZoneAbbr: ${this.ZoneAbbr}, CountryISO3: ${this.CountryISO3}, UtcOffset: ${this.UtcOffset}`;\n  }\n}<\/pre>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":20,"featured_media":0,"parent":9344,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-9346","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>PVI - REST<\/title>\n<meta name=\"description\" content=\"C#PythonNodeJS Phone Validation International C# Rest Code Snippet \ufeffusing System.Text.Json; using System.Web; namespace\" \/>\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-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PVI - REST\" \/>\n<meta property=\"og:description\" content=\"C#PythonNodeJS Phone Validation International C# Rest Code Snippet \ufeffusing System.Text.Json; using System.Web; namespace\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-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-26T22:15:23+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-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/\",\"url\":\"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/\",\"name\":\"PVI - REST\",\"isPartOf\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/#website\"},\"datePublished\":\"2023-06-05T18:22:16+00:00\",\"dateModified\":\"2025-09-26T22:15:23+00:00\",\"description\":\"C#PythonNodeJS Phone Validation International C# Rest Code Snippet \ufeffusing System.Text.Json; using System.Web; namespace\",\"breadcrumb\":{\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DOTS Phone Validation International\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PVI &#8211; Code Snippets and Sample Code\",\"item\":\"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"PVI &#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":"PVI - REST","description":"C#PythonNodeJS Phone Validation International C# Rest Code Snippet \ufeffusing System.Text.Json; using System.Web; namespace","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-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/","og_locale":"en_US","og_type":"article","og_title":"PVI - REST","og_description":"C#PythonNodeJS Phone Validation International C# Rest Code Snippet \ufeffusing System.Text.Json; using System.Web; namespace","og_url":"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/","og_site_name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","article_modified_time":"2025-09-26T22:15:23+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-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/","url":"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/","name":"PVI - REST","isPartOf":{"@id":"https:\/\/www.serviceobjects.com\/docs\/#website"},"datePublished":"2023-06-05T18:22:16+00:00","dateModified":"2025-09-26T22:15:23+00:00","description":"C#PythonNodeJS Phone Validation International C# Rest Code Snippet \ufeffusing System.Text.Json; using System.Web; namespace","breadcrumb":{"@id":"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/pvi-rest\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.serviceobjects.com\/docs\/"},{"@type":"ListItem","position":2,"name":"DOTS Phone Validation International","item":"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/"},{"@type":"ListItem","position":3,"name":"PVI &#8211; Code Snippets and Sample Code","item":"https:\/\/www.serviceobjects.com\/docs\/dots-phone-validation-international\/pvi-code-snippets-and-sample-code\/"},{"@type":"ListItem","position":4,"name":"PVI &#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\/9346","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\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/comments?post=9346"}],"version-history":[{"count":28,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/9346\/revisions"}],"predecessor-version":[{"id":12345,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/9346\/revisions\/12345"}],"up":[{"embeddable":true,"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/9344"}],"wp:attachment":[{"href":"https:\/\/www.serviceobjects.com\/docs\/wp-json\/wp\/v2\/media?parent=9346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}