Data8 Logo

DescriptionEndpoint URLsParametersAdvanced OptionsResultsCredit UsageSample CodeLive Demo
Cleanse
Checks if an email address is valid, and suggests possible corrections.
Description

Checks an email address for validity at the requested level, and provides suggested corrections. The service can suggest corrections for misspelt email domains and mailboxes, and common errors such as incorrect punctuation. For the best results, supply the person's name as part of the record parameter.

Endpoint URLs

To connect to this service you'll need to use one of these endpoints:

Protocol URL
JSON
JSON
https://webservices.data-8.co.uk/EmailValidation/Cleanse.json
OPEN API
OPEN API
https://webservices.data-8.co.uk/swagger/EmailValidation/swagger.json
SOAP
SOAP
https://webservices.data-8.co.uk/emailvalidation.asmx
Parameters
The following parameters can be supplied to this method:
Name Description
username
username

See the available authentication methods. If you are using username & password authentication, specify the username to authenticate as. If you are using API Key authentication and you are not using the JSON, Javascript or ADO APIs, use your API Key here with the prefix apikey-, e.g. apikey-ABCD-1234-EFGH-5678

password
password

If you are using username & password authentication, specify the password to use for authentication. Otherwise leave this blank.

email
email

The email address to validate

level
level

The level to validate the email to. The following values are currently supported:

  • Syntax - the supplied email is checked to ensure that it meets the standard email address format.
    This is the quickest option and would reject such incorrect email addresses as "noone@nowhere" and "N/A", but would accept incorrect email addresses that are correctly formed but that do not include a valid domain name such as "noone@data-9.com"
  • MX - the supplied email is checked to ensure that the domain name (the part to the right of the @ sign) exists and is set up to receive email.
    This is still normally very quick, but can take a few seconds in some cases. This check would reject incorrectly formatted email addresses in the same way as the Syntax check, and would also reject a misspelled domain name such as "noone@data-9.com". It can also detect when a domain name exists but does not handle email, such as "noone@example.com".
    It does not verify that the part of the email address to the left of the @ sign exists.
  • Server - in addition to the MX level checks, validates that at least one of the mail servers advertised for the domain is actually live.
  • Address - in addition to the Server level checks, validates that the mail server accepts mail for the full email address.
record
record

Additional details about the person or company the email is for that can aid with suggesting corrections. This data is not required but can make the service give better results. This object has the following properties:

  • CompanyName - the name of the company the email address is for
  • Name - the name of the person the email address is for
  • Address - the address of the company or person
options
options

An array of options that control further details of how this method operates. See the Advanced Options section below, for more information.

Advanced Options
The following options can be specified as part of the option parameter. Each option is specified as a key/value pair. The list of available names is shown below, along with a description of the allowable values for that name.
Name Description
Common Options
ApplicationName
ApplicationName
Gives the name of the calling application - used to break down usage by application in the usage reports on the dashboard.
Service Specific Options
MissingMXRecordHandling
MissingMXRecordHandling

If the level parameter is set to MX, the domain does not have any advertised mail servers, and it does have some possible IP addresses, this option determines how validation should proceed.

The default ServerCheck automatically upgrades the validation level to Server to get a more accurate validation result, but causes the request to take longer.

Alternatively the values AssumeValid or AssumeInvalid can be specified to automatically return a Valid or Invalid result respectively in these cases, resulting in a much faster result.

Results
This method returns an object containing the following fields:
Name Description
Status
Status

Indicates whether the method call was successful, or if some error occurred. If the Success field is true, the other results described below can be used to get the results of the method. If Success is false, some error occurred in calling the method, such as the authentication failed or the account is out of credits. The details of the error can be obtained from the ErrorMessage field, and any other results should be ignored.

Result
Result

A status code indicating if the email address could be validated. The following values are available:

  • Valid - according to the selected level of validation, the email address appears to be valid. This is not an absolute guarantee that emails sent to this address will be delivered and read.
  • Invalid - the email address is invalid. This is a definite assessment that emails sent to this address cannot be delivered.
  • Inconclusive - a precise Valid or Invalid result could not be determined. This is normally because the server being used for the address being checked did not respond in time, or did not provide sufficient information.
  • CatchAll - when performing Address level validation, the mail server was determined as accepting mail for any address provided to it. The address being checked will be accepted, but may be returned later.
  • GreyListed - when performing Address level validation, the mail server declined to indicate whether the address was valid or not due to a greylisting rule. Trying to validate the address again in a few minutes may elicit a more accurate response.
OriginalValid
OriginalValid

Indicates if the original email address was valid before being corrected

EmailType
EmailType

Indicates the type of email address that was supplied. This can be one of the following values:

  • Personal - the address is the personal email address of the user at their company.
  • ISP - the address is provided by the user's ISP
  • Free - the address is provided by a free email provider such as Hotmail
  • Generic - the address is a catch-all address at a company, such as sales@example.com
  • Disposable - the address is provided by a disposable email provider. The address may be valid now but will not be valid soon after.
SuggestedEmailAddress
SuggestedEmailAddress

A suggested correction of the supplied email address

Comment
Comment

A free-text description of why the email address was modified

Salutation
Salutation

The suggested name to be used in the greeting line of an email to this address

StructureUsed
StructureUsed

A description of the structure of the username part of the email address

ParsedName
ParsedName

A parsed name constructed from the email address

Credit Usage

Each request to this method consumes 1 EmailValidation credit.

Sample Code

Request Format

{
  "email": "joe.blogs@data-8.co.uk",
  "level": "MX",
  "record": null,
  "options": {
    "MissingMXRecordHandling": "ServerCheck"
  }
}

Response Format

{
  "Status": {
    "Success": true,
    "CreditsRemaining": 1000
  },
  "Result": "CatchAll",
  "OriginalValid": true,
  "EmailType": "Personal",
  "SuggestedEmailAddress": "joe.bloggs@data-8.co.uk",
  "Comment": "Potential Mispelling detected in blogs",
  "Salutation": "Joe",
  "StructureUsed": "<FORENAME>.<SURNAME>",
  "ParsedName": {
    "Forename": "Joe",
    "Surname": "Blogs"
  }
}

Depending on your chosen authentication method you will need to modify this request slightly:

API Key

Post the request to
https://webservices.data-8.co.uk/EmailValidation/Cleanse.json?key=your-api-key
and do NOT include the username or password properties in the request JSON document.
Read More

Username and Password

Post the request to
https://webservices.data-8.co.uk/EmailValidation/Cleanse.json
and include username and password properties in the request JSON document.
Do not use for client-side requests!
Read More

JWT Token

Obtain a JWT token for your user and post the request to
https://webservices.data-8.co.uk/EmailValidation/Cleanse.json
Include the JWT token in the request headers as:
Authorization: Bearer your-jwt-token
Read More
Live Demo
Parameter Value
Parameters
email
email
level
level
SyntaxMXServerAddress
record
CompanyName
CompanyName
Name
Name
Title
Forename
MiddleName
Surname
Address
Address
Lines
Add Remove
Common Options
ApplicationName
ApplicationName
Service-Specific Options
MissingMXRecordHandling
MissingMXRecordHandling
Credits Remaining Today: 5
Try It Now!
An error has occurred. This application may no longer respond until reloaded. Reload 🗙