Use this endpoint to suggest last names based on user input.
For first name suggestions, see Name API — First name validation →
/LASTNAMESUGGEST/
Request
Both GET and POST are supported.
Code examples
Last name suggestion
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
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