Validate a mobile phone number
Find out what you can do with our API...
Validate a UK mobile phone number. Returns the current network, original network (if ported) and flags to indicate if currently live or known to be ceased. Note that this service does not call or 'ping' the number.
Our validate_mobile_phone_number method helps improve your data accuracy. Use it during eCommerce checkout to ensure a correct mobile number is entered or offline on your customer management systems.
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 mobile number |
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_mobile_phone_number_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. |
network | The name of the current mobile network. |
network_original | The original network name. |
telephone_number | The number, formatted. |
mnc | The Mobile Network Code (MNC); a code describing the
current network provider. |
mcc | The Mobile Country Code (MCC). This is NOT
determined by the current location of the handset, but
by the network provider’s country. |
country_name | The verbose name which matches the Mobile Country Code (MCC). This is NOT determined by the current location of the handset, but by the network provider’s country. |
on | true if the number is believed to be in use. |
dead | true if the number is known to have ceased. |
Error Codes
Name | Description |
---|---|
invalid_telephone_number | The telephone number is invalid |
missing_telephone_number | Missing the telephone number |
Also see the common error codes.
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_mobile_phone_number_res> <mode>normal</mode> <status>ok</status> <credit_used>0</credit_used> <chargeable>false</chargeable> <t2a_version_number>1.0.0</t2a_version_number> <telephone_number>(07778) 000000</telephone_number> <network>UK - VODAFONE</network> <network_original>Vodafone Uk Ltd</network_original> <mnc>15</mnc> <mcc>234</mcc> <on>true</on> <dead>false</dead> </validate_mobile_phone_number_res>