Name API — Last name validation

Support DQE
Support DQE
  • Updated
Name API - Suggest last names

Use this endpoint to suggest last names based on user input.

Related Name documentation - For a service overview, see Name API — Introduction →
For first name suggestions, see Name API — First name validation →

/LASTNAMESUGGEST/

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}/LASTNAMESUGGEST/?Lastname={NAME}&NBResponse={NUM}&Licence={LICENCE_CODE}&Format={FORMAT}

Code examples

Last name suggestion

curl "https://{SERVER_ADDRESS}/LASTNAMESUGGEST/?Lastname=Dup&NBResponse=10&Format=0&Licence={LICENCE_CODE}"
fetch("https://{SERVER_ADDRESS}/LASTNAMESUGGEST/?" + new URLSearchParams({ Lastname: "Dup", NBResponse: "10", Format: "0", Licence: "{LICENCE_CODE}" })) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.get( "https://{SERVER_ADDRESS}/LASTNAMESUGGEST/", params={ "Lastname": "Dup", "NBResponse": "10", "Format": "0", "Licence": "{LICENCE_CODE}", }, ) print(response.json())
<?php $params = http_build_query([ 'Lastname' => 'Dup', 'NBResponse' => '10', 'Format' => '0', 'Licence' => '{LICENCE_CODE}', ]); $ch = curl_init("https://{SERVER_ADDRESS}/LASTNAMESUGGEST/?{$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}/LASTNAMESUGGEST/', { params: { Lastname: 'Dup', NBResponse: '10', Format: '0', Licence: '{LICENCE_CODE}' } }) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String url = "https://{SERVER_ADDRESS}/LASTNAMESUGGEST/" + "?Lastname=Dup&NBResponse=10&Format=0&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}/LASTNAMESUGGEST/" + "?Lastname=Dup&NBResponse=10&Format=0&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}/LASTNAMESUGGEST/" + "?Lastname=Dup&NBResponse=10&Format=0&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}/LASTNAMESUGGEST/

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

Code examples

Last name suggestion

curl -X POST "https://{SERVER_ADDRESS}/LASTNAMESUGGEST/" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "Licence={LICENCE_CODE}" \ -d "Lastname=Dup" \ -d "NBResponse=10" \ -d "Format=0"
fetch("https://{SERVER_ADDRESS}/LASTNAMESUGGEST/", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ Licence: "{LICENCE_CODE}", Lastname: "Dup", NBResponse: "10", Format: "0" }) }) .then(r => r.json()) .then(data => console.log(data));
import requests response = requests.post( "https://{SERVER_ADDRESS}/LASTNAMESUGGEST/", data={ "Licence": "{LICENCE_CODE}", "Lastname": "Dup", "NBResponse": "10", "Format": "0", }, ) print(response.json())
<?php $ch = curl_init("https://{SERVER_ADDRESS}/LASTNAMESUGGEST/"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ 'Licence' => '{LICENCE_CODE}', 'Lastname' => 'Dup', 'NBResponse' => '10', 'Format' => '0', ])); 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}/LASTNAMESUGGEST/', qs.stringify({ Licence: '{LICENCE_CODE}', Lastname: 'Dup', NBResponse: '10', Format: '0' })) .then(response => console.log(response.data));
HttpClient client = HttpClient.newHttpClient(); String form = "Licence={LICENCE_CODE}&Lastname=Dup&NBResponse=10&Format=0"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://{SERVER_ADDRESS}/LASTNAMESUGGEST/")) .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> { ["Licence"] = "{LICENCE_CODE}", ["Lastname"] = "Dup", ["NBResponse"] = "10", ["Format"] = "0" }; var response = await client.PostAsync( "https://{SERVER_ADDRESS}/LASTNAMESUGGEST/", 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("Licence", "{LICENCE_CODE}") form.Set("Lastname", "Dup") form.Set("NBResponse", "10") form.Set("Format", "0") resp, err := http.PostForm("https://{SERVER_ADDRESS}/LASTNAMESUGGEST/", form) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) }

Parameters

Parameter Description Mand / Opt
Licence Licence code assigned to your account. Mandatory
Lastname Part of the last name already entered by the user. Mandatory
NBResponse Maximum number of suggestions to return. Default: 10. Optional
Format Desired output format. Default: 0. Optional

Format values

Format Description
0 Last name in uppercase without accents.
1 First letter uppercase without accents.
2 Last name in lowercase without accents.
3 Last name in uppercase with accents.
4 First letter uppercase with accents.
5 Last name in lowercase with accents.

Response

The JSON response is a dictionary containing the suggest key. Its value is an array of suggested items. Each item is an array of two strings: the first value is always I, and the second value is the suggested last name.

Key Possible values Description Type
suggest[X][0] I Always I (unknown) — last names have no gender distinction. STRING(1)
suggest[X][1] — Suggested last name. STRING(255)

Response example

{
  "suggest": [
    ["I", "DUPONT"],
    ["I", "DUPOUY"],
    ["I", "DUPORT"]
  ]
}

Errors

Error type Request example Response body
Missing, empty, or incorrect Licence parameter https://{SERVER_ADDRESS}/LASTNAMESUGGEST/?Lastname=Dup&NBResponse=10
{}
Missing or empty Lastname parameter https://{SERVER_ADDRESS}/LASTNAMESUGGEST/?NBResponse=10&Licence={LICENCE_CODE}
{"suggest": []}
Parameter typo https://{SERVER_ADDRESS}/LASTNAMESUGGEST/?Lasname=Dup&NBResponse=10&Licence={LICENCE_CODE}
{"suggest": []}

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