Validate a phone number
Find out what you can do with our API...
Validates a UK telephone number, returning the provider; note that this service does not call or 'ping' the number.
Check a phone number against the official list of valid telephone number ranges.
Help your visitors avoid typing errors when entering their phone number. Once a number is entered it can be checked against the official list of valid telephone number ranges and invalid numbers can be flagged up.
Ensure your visitors are not entering false information on your website. Some visitors may attempt to provide you with an incorrect phone number in order to conceal their identity. By using our phone number validation service, invalid numbers can be immediately identified, allowing you to request the correct information.
Mandatory Parameters
Name | Description |
---|---|
api_key or javascript_key |
Use your API key if invoking server-side. If invoking from the browser via JavaScript, generate a JavaScript key using the javascript_key method. |
telephone_number | Enter a UK telephone number; mobile numbers are permitted. |
Optional Parameters
Name | Description |
---|---|
client | You can optionally include an identifier for your final client or user. This is logged in your usage log and you will be able to view your usage statistics by client. |
output | Set to json for a JSON response; the default response is XML.
Not applicable to the SOAP API. |
callback | When using JSON, specify a JSONP wrapper in which the JSON response is to be wrapped. |
Returned Values
The XML response is contained within a <validate_telephone_res>
element.
Name | Description |
---|---|
status | Returns ok if the operation has succeeded, or error if an
error has occurred; Returns the error_code for error details. |
error_code | Returns the error code when the status is error . See below for error codes. |
t2a_version_number | The current API version number. |
credit_used | The number of credits used in order to execute the request. | mode | Returns normal or test when executed in the
free test mode. |
provider | The name of the telephony provider. |
telephone_number | The number, formatted. |
Error Codes
See the common error codes. There are no errors which are specific to this method.
Free Test Mode
When operating in the free test mode errors are returned if mandatory parameters are missing, or it returns a dummy data response, in an identical format to a real response.
Note that the mode
is returned as test
when the method is operating in the free test mode.
Example XML Response
<?xml version="1.0"?> <validate_telephone_res> <mode>normal</mode> <status>ok</status> <t2a_version_number>1.0.0</t2a_version_number> <telephone_number>(01904) 217765</telephone_number> <provider>Affiniti Integrated Solutions Ltd</provider> </validate_telephone_res>