Email API — Email address suggestions

Support DQE
Support DQE
  • Updated
Email Suggestion - Classic API

The MAILSUGGEST endpoint suggests likely email addresses based on a user's last name, first name, and the characters already entered, optionally biased toward domains common in a given country.

When to use this endpoint - Call MAILSUGGEST while the user is still typing their email address, to offer autocomplete suggestions based on their name. To validate a complete email address instead, see Email API — Validate an email address →

MAILSUGGEST

Request

Both GET and POST are supported.

{SERVER_ADDRESS} and {LICENCE_CODE} are provided by DQE upon account creation. Contact your DQE account manager to obtain these credentials.
GEThttps://{SERVER_ADDRESS}/MAILSUGGEST/?Nom={NAME}&Prenom={FIRST_NAME}&Email={EMAIL}&Pays={COUNTRY_CODE}&Licence={LICENCE_CODE}

Code examples

Testa Testb, no partial email entered yet

curl "https://{SERVER_ADDRESS}/MAILSUGGEST/?Nom=Testb&Prenom=Testa&Email=&Pays=FRA&Licence={LICENCE_CODE}"
fetch("https://{SERVER_ADDRESS}/MAILSUGGEST/?" + new URLSearchParams({ Nom: "Testb", Prenom: "Testa", Email: "", Pays: "FRA", Licence: "{LICENCE_CODE}" })) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.get( "https://{SERVER_ADDRESS}/MAILSUGGEST/", params={ "Nom": "Testb", "Prenom": "Testa", "Email": "", "Pays": "FRA", "Licence": "{LICENCE_CODE}", }, ) print(response.json())
<?php $params = http_build_query([ 'Nom' => 'Testb', 'Prenom' => 'Testa', 'Email' => '', 'Pays' => 'FRA', 'Licence' => '{LICENCE_CODE}', ]); $ch = curl_init("https://{SERVER_ADDRESS}/MAILSUGGEST/?{$params}"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true);
const axios = require('axios'); axios.get('https://{SERVER_ADDRESS}/MAILSUGGEST/', { params: { Nom: 'Testb', Prenom: 'Testa', Email: '', Pays: 'FRA', Licence: '{LICENCE_CODE}' } }) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String url = "https://{SERVER_ADDRESS}/MAILSUGGEST/" + "?Nom=Testb&Prenom=Testa&Email=&Pays=FRA&Licence={LICENCE_CODE}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .GET() .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());
using var client = new HttpClient(); var url = "https://{SERVER_ADDRESS}/MAILSUGGEST/" + "?Nom=Testb&Prenom=Testa&Email=&Pays=FRA&Licence={LICENCE_CODE}"; var response = await client.GetAsync(url); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
package main import ( "fmt" "io" "net/http" ) func main() { url := "https://{SERVER_ADDRESS}/MAILSUGGEST/" + "?Nom=Testb&Prenom=Testa&Email=&Pays=FRA&Licence={LICENCE_CODE}" resp, err := http.Get(url) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }
POSThttps://{SERVER_ADDRESS}/MAILSUGGEST/

Send all parameters in the request body using Content-Type: application/x-www-form-urlencoded. The server address remains in the URL.

Code examples

Testa Testb, no partial email entered yet

curl -X POST "https://{SERVER_ADDRESS}/MAILSUGGEST/" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "Nom=Testb" \ -d "Prenom=Testa" \ -d "Email=" \ -d "Pays=FRA" \ -d "Licence={LICENCE_CODE}"
fetch("https://{SERVER_ADDRESS}/MAILSUGGEST/", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ Nom: "Testb", Prenom: "Testa", Email: "", Pays: "FRA", Licence: "{LICENCE_CODE}" }) }) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.post( "https://{SERVER_ADDRESS}/MAILSUGGEST/", data={ "Nom": "Testb", "Prenom": "Testa", "Email": "", "Pays": "FRA", "Licence": "{LICENCE_CODE}", }, ) print(response.json())
<?php $ch = curl_init("https://{SERVER_ADDRESS}/MAILSUGGEST/"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ 'Nom' => 'Testb', 'Prenom' => 'Testa', 'Email' => '', 'Pays' => 'FRA', 'Licence' => '{LICENCE_CODE}', ])); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = json_decode($response, true);
const axios = require('axios'); const qs = require('querystring'); axios.post('https://{SERVER_ADDRESS}/MAILSUGGEST/', qs.stringify({ Nom: 'Testb', Prenom: 'Testa', Email: '', Pays: 'FRA', Licence: '{LICENCE_CODE}' })) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String form = "Nom=Testb&Prenom=Testa&Email=&Pays=FRA&Licence={LICENCE_CODE}"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{SERVER_ADDRESS}/MAILSUGGEST/")) .header("Content-Type", "application/x-www-form-urlencoded") .POST(HttpRequest.BodyPublishers.ofString(form)) .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());
using var client = new HttpClient(); var form = new Dictionary<string, string> { ["Nom"] = "Testb", ["Prenom"] = "Testa", ["Email"] = "", ["Pays"] = "FRA", ["Licence"] = "{LICENCE_CODE}" }; var response = await client.PostAsync( "https://{SERVER_ADDRESS}/MAILSUGGEST/", new FormUrlEncodedContent(form)); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);
package main import ( "fmt" "io" "net/http" "net/url" ) func main() { form := url.Values{} form.Set("Nom", "Testb") form.Set("Prenom", "Testa") form.Set("Email", "") form.Set("Pays", "FRA") form.Set("Licence", "{LICENCE_CODE}") resp, err := http.PostForm("https://{SERVER_ADDRESS}/MAILSUGGEST/", form) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }

Parameters

Parameter Description Mand / Opt
Nom Last name entered by the user.
Can be left empty
Mandatory
Prenom First name entered by the user.
Can be left empty
Mandatory
Email Part of the email address already entered by the user.
Can be left empty
Mandatory
Pays ISO 3166-1 alpha-3 country code, used to bias suggested domains toward a specific country.
Default: FRA
Optional
Licence Your DQE licence key. Contact support if you do not yet have one. Mandatory

Response

On success, the API returns a JSON object containing the suggested email addresses.

Key Description Type
Instance Legacy field, no longer used. String
syntaxe ok or ko, depending on the syntax of the email already entered. String
suggest List of suggested email addresses. Array

Response example

Testa Testb, no partial email entered yet
{ "Instance": "0", "suggest": [ "ttesta@", "testat@", "t.testa@", "testbtesta@", "ttestb@", "testatestb@", "testa.testb@", "testb.testa@", "testb-testa@", "testa-testb@", "t-testa@", "testa-t@" ], "syntaxe": "ok" }

Errors

HTTP Error type Response
400 Missing Licence parameter Bad Request
400 Empty Licence parameter Bad Request
— Incorrect licence number Empty response body (no error code)

Test the API

Click the button below to test this endpoint live in your browser.

Open console

See also

Related to

Was this article helpful?

0 out of 0 found this helpful