Checks a telephone number for validity. Details of the number's validity and other attributes are included in the result.
This service is deprecated in favour of the PhoneValidation
service. This service will remain operational for the foreseeable future, but the PhoneValidation
service should be used for all new development.
The telephone number can be supplied as either a full international number with leading + or 00 prefix (e.g. +441513554555) or as a national number (e.g. 01513554555), with or without additional formatting (e.g. spaces, brackets etc.). If a number is supplied as a national number, the default country code is used to identify which country the number is located in. The default country code can be supplied as any of:
- international telephone dialling code (e.g. 44)
- ISO 2-character code (e.g. GB)
- ISO 3-character code (e.g. GBR)
- ISO standard English country name (e.g United Kingdom)
If the ValidationResult
member of the returned structure is Invalid
, the supplied telephone number is invalid and cannot be called. If it is Valid
the telephone number is likely to be valid. This does not necessarily mean that the number can be called and is owned by the expected person, but does indicate that the number lies within a range of numbers that have been allocated for use. If it is NoCoverage
we cannot provide an indication to it's validity and you should normally treat it as valid.
This service is not appropriate if you require an absolute indication that a telephone number is valid for a particular individual. In those circumstances, you should consider the use of a telephone number capture service. However, this service does provide a quick and inexpensive method for preventing accidentally mis-typed numbers.
Numbers that start with 070
, often referred to as personal numbers, are incredibly difficult to validate with any certainty, due to their private nature. We have created an option you can pass in to the API code, ExcludeUnlikelyNumbers
, which will stop the likes of 07000000000
or 07077777777
getting through our validation. Please bear in mind that with this option, you may well exclude a small amount of genuine numbers.
To connect to this service you'll need to use one of these endpoints:
Protocol | URL |
---|---|
JSON |
JSON
https://webservices.data-8.co.uk/InternationalTelephoneValidation/IsValid.json |
OPEN API |
OPEN API
https://webservices.data-8.co.uk/swagger/InternationalTelephoneValidation/swagger.json |
SOAP |
SOAP
https://webservices.data-8.co.uk/internationaltelephonevalidation.asmx |
Name | Description |
---|---|
username | username
See the available authentication methods. If you are using username & password authentication, specify the username to authenticate as. If you are using API Key authentication and you are not using the JSON, Javascript or ADO APIs, use your API Key here with the prefix |
password | password
If you are using username & password authentication, specify the password to use for authentication. Otherwise leave this blank. |
telephoneNumber | telephoneNumber
The telephone number to validate |
defaultCountry | defaultCountry
The ISO 2-character country code or international dialling code of the country to validate the |
options | options
An array of options that control further details of how this method operates. See the |
option
parameter. Each option is specified as a key/value pair.
The list of available names is shown below, along with a description of the allowable values for that name.
Name | Description |
---|---|
Common Options | |
ApplicationName |
ApplicationName
Gives the name of the calling application - used to break down usage by application in the usage reports on the dashboard.
|
Service Specific Options | |
UseMobileValidation | UseMobileValidation
If set to true then the service will use |
UseLineValidation | UseLineValidation
If set to true then the service will use |
RequiredCountry | RequiredCountry
Indicates the country that the number must be in to be considered valid. This should be provided as the ISO 2-character country code. |
AllowedPrefixes | AllowedPrefixes
A comma-separated list of prefixes in standard international format that the number must start with to be treated as valid. For example, use "+441,+442" to allow only standard UK landline numbers. |
BarredPrefixes | BarredPrefixes
A comma-separated list of prefixes in standard international format that will cause the number to be treated as invalid. For example, use "+90,+447781" to block any Indian numbers or numbers allocated to C&W Guernsey. |
UseUnavailableStatus | UseUnavailableStatus
When using the |
UseAmbiguousStatus | UseAmbiguousStatus
When using the |
TreatUnavailableMobileAsInvalid | TreatUnavailableMobileAsInvalid
When using the |
ExcludeUnlikelyNumbers | ExcludeUnlikelyNumbers
If set to |
Name | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Status | Status
Indicates whether the method call was successful, or if some error occurred. If the | ||||||||||||||||||
Result | Result
Contains properties indicating the validity and other information for the supplied telephone number:
|
Each request to this method consumes 1 International Telephone Validation credit for each request, except where a "NoCoverage" result is returned. If the "UseLineValidation" option is specified and a UK landline number is entered, or if the "UseMobileValidation" and a mobile number is entered, a Live Number Testing or Mobile Validation credit will be consumed instead.
Request Format
{ "telephoneNumber": "0151 355 4555", "defaultCountry": "GB", "options": { "UseMobileValidation": false, "UseLineValidation": false, "RequiredCountry": null, "AllowedPrefixes": null, "BarredPrefixes": null, "UseUnavailableStatus": null, "UseAmbiguousStatus": null, "TreatUnavailableMobileAsInvalid": null, "ExcludeUnlikelyNumbers": null } }
Response Format
{ "Status": { "Success": true, "CreditsRemaining": 1000 }, "Result": { "TelephoneNumber": "+441513554555", "ValidationResult": "Valid", "ValidationLevel": "Exchange", "NumberType": "Landline", "Location": "Liverpool", "Provider": "BT", "CountryCode": "GB", "CountryName": "United Kingdom" } }
Depending on your chosen authentication method you will need to modify this request slightly:
API Key
https://webservices.data-8.co.uk/InternationalTelephoneValidation/IsValid.json?key=your-api-key
and do NOT include the
username
or password
properties in the request JSON document.
Username and Password
https://webservices.data-8.co.uk/InternationalTelephoneValidation/IsValid.json
and include
username
and password
properties in the request JSON document.Do not use for client-side requests!
JWT Token
https://webservices.data-8.co.uk/InternationalTelephoneValidation/IsValid.json
Include the JWT token in the request headers as:
Authorization: Bearer your-jwt-token
Parameter | Value |
---|---|
Parameters | |
telephoneNumber | telephoneNumber
|
defaultCountry | defaultCountry
|
Common Options | |
ApplicationName |
ApplicationName
|
Service-Specific Options | |
UseMobileValidation |
UseMobileValidation |
UseLineValidation |
UseLineValidation |
RequiredCountry |
RequiredCountry |
AllowedPrefixes |
AllowedPrefixes |
BarredPrefixes |
BarredPrefixes |
UseUnavailableStatus |
UseUnavailableStatus |
UseAmbiguousStatus |
UseAmbiguousStatus |
TreatUnavailableMobileAsInvalid |
TreatUnavailableMobileAsInvalid |
ExcludeUnlikelyNumbers |
ExcludeUnlikelyNumbers |
Credits Remaining Today: 15 |