Phone Number Format Validation
This is a free endpoint and will let you know if the phone number matches the format of the country you pass through in the countryCode parameter
Endpoint
[POST] https://usenotifier.com/api/validateExample Request
$response = Http::withToken('YOUR_API_KEY')
->post('https://usenotifier.com/api/validate', [
"phoneNumber" => "07700900389",
"countryCode" => "GB"
]);$client = new Client();
$headers = [
'Accept' => 'application/json',
'Authorization' => 'Bearer YOUR_API_KEY',
'Content-Type' => 'application/x-www-form-urlencoded'
];
$options = [
'form_params' => [
'phoneNumber' => '07700900389',
'countryCode' => 'GB'
]];
$request = new Request('POST', 'https://usenotifier.com/api/validate', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();curl --location --request POST 'https://usenotifier.com/api/validate'
--header 'Accept: application/json'
--header 'Authorization: Bearer YOUR_API_KEY'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'phoneNumber=07700900389'
--data-urlencode 'countryCode=GB'var client = new RestClient("https://usenotifier.com/api/validate");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer YOUR_API_KEY");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("phoneNumber", "07700900389");
request.AddParameter("countryCode", "Hello World!");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);phoneNumber: required
The phone number to validate. Don't worry about formatting, you can leave that to us!
countryCode: required
The 2 character ISO 3166 country code you want to validate the phone number against. Get a list of valid codes.
Example Response
{
"valid_format": true,
"country" : "GB",
"type" : "mobile"
}The type of phone will be given, with the options being:
FIXED_LINE
MOBILE
FIXED_LINE_OR_MOBILE
TOLL_FREE
PREMIUM_RATE
SHARED_COST
VOIP
PERSONAL_NUMBER
PAGER
UAN
UNKNOWN
EMERGENCY
VOICEMAIL
SHORT_CODE
STANDARD_RATE
Last updated
Was this helpful?