Validate
validate-phone
GET /validate/phone/{number}
Validate phone number
Ensure that the phone number is valid
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
number | path | string | true | URL-encoded phone number in international format (e.g. +441234567890) |
country | query | QueryParamCountry | false | ISO country code (two letters) |
x-api-key | header | string | false | API Authentication Key |
Example responses
Phone validation results object
{
"countryCode": "US",
"phoneNumber": "+1234567890",
"nationalFormat": "(123) 456-7890"
}
{
"error": "Invalid number"
}
An error message
{
"countryCode": "US",
"phoneNumber": "+1234567890",
"nationalFormat": "(123) 456-7890"
}
{
"error": "Invalid number"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Phone validation results object | VerifyPhoneResponse |
500 | Internal Server Error | An error message | VerifyPhoneResponse |
Code samples
"""
Python Code Snippet
"""
import requests
headers = {
'Accept': 'application/json',
'x-api-key': 'string'
}
r = requests.get('https://data.autohost.ai/v1/validate/phone/{number}', headers=headers)
print(r.json())
/*
TypeScript Code Snippet
*/
import fetch from 'node-fetch';
const headers = {
'Accept':'application/json',
'x-api-key':'string'
};
const response = await fetch('https://data.autohost.ai/v1/validate/phone/{number}', {
method: 'get',
headers,
});
const responseJson = await response.json();
console.log(responseJson);
validate-email
GET /validate/email/{email}
Validate email address
Ensure that the email address is valid
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
path | string | true | URL encoded email address | |
x-api-key | header | string | false | API Authentication Key |
Example responses
Email validation results object
{
"status": "VALID"
}
{
"status": "INVALID"
}
500 Response
{
"error": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Email validation results object | VerifyEmailResponse |
500 | Internal Server Error | An error message | ErrorResponse |
Code samples
"""
Python Code Snippet
"""
import requests
headers = {
'Accept': 'application/json',
'x-api-key': 'string'
}
r = requests.get('https://data.autohost.ai/v1/validate/email/{email}', headers=headers)
print(r.json())
/*
TypeScript Code Snippet
*/
import fetch from 'node-fetch';
const headers = {
'Accept':'application/json',
'x-api-key':'string'
};
const response = await fetch('https://data.autohost.ai/v1/validate/email/{email}', {
method: 'get',
headers,
});
const responseJson = await response.json();
console.log(responseJson);