Validate
Validate phone number
GET /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 address
GET /validate/email/{email}
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",
"result": {
"isEduEmail": true,
"emailDomainEducation": {
"name": "University of California, Berkeley",
"countryName": "United States",
"countryCode": "US",
"domains": [
"berkeley.edu"
],
"urls": [
"https://www.berkeley.edu"
]
}
}
}
{
"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);
Schemas
QueryParamCountry
"string"
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | none |
VerifyPhoneResponse
{
"countryCode": "string",
"phoneNumber": "string",
"nationalFormat": "string",
"error": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| countryCode | string | false | none | none |
| phoneNumber | string | false | none | none |
| nationalFormat | string | false | none | none |
| error | string | false | none | none |
VerifyEmailResponse
{
"status": "string",
"result": {
"isEduEmail": true,
"emailDomainEducation": {
"name": "string",
"countryName": "string",
"countryCode": "string",
"domains": [
"string"
],
"urls": [
"string"
]
}
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| status | string | false | none | none |
| result | object | false | none | none |
| » isEduEmail | boolean | false | none | Whether the email is a university or school email |
| » emailDomainEducation | object | false | none | none |
| »» name | string | false | none | The name of the school or university |
| »» countryName | string | false | none | The name of the country |
| »» countryCode | string | false | none | The code of the country |
| »» domains | [string] | false | none | none |
| »» urls | [string] | false | none | none |
ErrorResponse
{
"error": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| error | string | false | none | none |