GET api/reference/validatephone?pn={pn}&cc={cc}
Tests to see if a supplied phone number is valid for the country code provided. This only validates that the phone number can be formatted as a valid phone number. It does not validate that the phone number is active.
Request Information
URI Parameters
| Name | Description | Type | Additional information |
|---|---|---|---|
| pn |
The phone number to validate. |
string |
Required |
| cc |
The 2 digit country code of the country to validate for. |
string |
Default value is US |
Body Parameters
None.
Response Information
Resource Description
An object representing the results of the validation
PhoneNumberValidationResult| Name | Description | Type | Additional information |
|---|---|---|---|
| RequestedPhoneNumber |
The original phone number requested. |
string |
None. |
| RequestedCountryCode |
The country code requested. |
string |
None. |
| PhoneNumberValid |
Is the phone number a valid number |
boolean |
None. |
| FormattedPhoneNumber |
Formatted valid phone number |
string |
None. |
Response Formats
application/json, text/json
Sample:
{
"RequestedPhoneNumber": "sample string 1",
"RequestedCountryCode": "sample string 2",
"PhoneNumberValid": true,
"FormattedPhoneNumber": "sample string 4"
}
application/xml, text/xml
Sample:
<PhoneNumberValidationResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <RequestedPhoneNumber>sample string 1</RequestedPhoneNumber> <RequestedCountryCode>sample string 2</RequestedCountryCode> <PhoneNumberValid>true</PhoneNumberValid> <FormattedPhoneNumber>sample string 4</FormattedPhoneNumber> </PhoneNumberValidationResult>