New!
Phone Validation APIThe JSON API provides capability to verify your customers phone numbers, regardless of their country of origin.
It supports CORS and can return data as JSON or JSONP.
Before creating a custom integration, please check our list of Data Validation Plugins. You might find something suitable for your platform there.
We also have a JavaScript library which implements a simple interface for forms and only takes a few minutes to integrate.
Request
https://api.craftyclicks.co.uk/phone/1.0/validate
The service accepts POST / GET requests.
Parameters
Key | Type | Required | Description |
---|---|---|---|
key | string | ✔️ | Your unique access token. |
phone_number | string | ✔️ | The phone number you wish to verify. |
country | string | 2 letter ISO 3166-2 country code. Not required, if the provided phone number is an international number. (starting with +) If the supplied phone_number is an international number, the country field will be ignored. | |
get_network | boolean | Specify if you need the carrier information. Default: false |
{
"key":"<<your access token>>",
"country": "GB",
"phone_number": "01628201254"
}
Response
Key | Type | Description |
---|---|---|
result | boolean | If the result is true , the queried phone number is valid. If it's false , none of the other values will exist in the response. |
country | string | 3 letter ISO 3166-1 alpha-3 country code, matching the phone number |
phone_number | string | The valid phone number in an international format. |
national_format | string | The valid phone number in a national format. |
carrier | object | Contains the network information, if it was requested. |
mobile_country_code | string | If the phone number is on a mobile network, this will contain the Mobile country code, otherwise it's null |
mobile_network_code | string | If the phone number is on a mobile network, this will contain the mobile network code, otherwise it's null . |
name | string | The name of the provider for the phone service. |
type | string | Can either be landline or mobile |
{
"result": true,
"country": "gbr",
"phone_number": "+441628201254",
"national_format": "01628 201254",
"carrier": {
"mobile_country_code": null,
"mobile_network_code": null,
"name": "Jersey Telecom",
"type": "landline",
"error_code": null
}
}