Skip to main content

Validate

validate-phone

GET /validate/phone/{number}

Validate phone number

Ensure that the phone number is valid

Parameters

NameInTypeRequiredDescription
numberpathstringtrueURL-encoded phone number in international format (e.g. +441234567890)
countryqueryQueryParamCountryfalseISO country code (two letters)
x-api-keyheaderstringfalseAPI 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

StatusMeaningDescriptionSchema
200OKPhone validation results objectVerifyPhoneResponse
500Internal Server ErrorAn error messageVerifyPhoneResponse

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

NameInTypeRequiredDescription
emailpathstringtrueURL encoded email address
x-api-keyheaderstringfalseAPI Authentication Key

Example responses

Email validation results object

{
"status": "VALID"
}
{
"status": "INVALID"
}

500 Response

{
"error": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKEmail validation results objectVerifyEmailResponse
500Internal Server ErrorAn error messageErrorResponse

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);