Use this endpoint to get a list of suggested email addresses based on the user's first name, last name, and the characters already entered in the email field.
Related Restful Email API documentation:
- Email API — Introduction
- Email API — Validate an email address (REST)
- Restful Email API Swagger documentation
GET request
Endpoint
GET https://{SERVER_ADDRESS}/{VERSION}/emailsuggest/?FirstName={FIRST_NAME}&LastName={LAST_NAME}&Email={EMAIL}&Country={COUNTRY_CODE}&Licence={LICENCE_CODE}
Replace the values in braces with your own information.
| Parameter | Description | Mandatory/Optional |
|---|---|---|
| FirstName | First name entered by the user. | Mandatory |
| LastName | Last name entered by the user. | Mandatory |
| Part of the email address already entered by the user. | Mandatory | |
| Country | ISO 3-letter country code. | Mandatory |
| Licence | Licence code assigned to your account. | Mandatory |
POST request
Endpoint
POST https://{SERVER_ADDRESS}/{VERSION}/emailsuggest/
Add the following parameters in the request body using x-www-form-urlencoded.
| Parameter | Description | Mandatory/Optional |
|---|---|---|
| FirstName | First name entered by the user. | Mandatory |
| LastName | Last name entered by the user. | Mandatory |
| Part of the email address already entered by the user. | Mandatory | |
| Country | ISO 3-letter country code. | Mandatory |
| Licence | Licence code assigned to your account. | Mandatory |
Response
Success response
The JSON response is a dictionary containing the number of results and an array of email suggestions.
| Key | Description | Type |
|---|---|---|
| Found | Number of suggestion results returned. | INTEGER |
| Suggestion | Array of suggestion results. | ARRAY |
| Instance | Custom value returned as-is in the response. | STRING |
| InputEmail | Email value as submitted in the request. | STRING |
| Syntaxe |
ok or ko, depending on the syntax of the email already entered. |
STRING |
| List | List of suggested email addresses. | ARRAY |
| ListCount | Number of suggested email addresses in List. |
INTEGER |
Example:
{
"Found": 1,
"Suggestion": [
{
"Instance": "0",
"InputEmail": "",
"Syntaxe": "ok",
"List": [
"jlim@"
],
"ListCount": 8
}
]
}
Error response
| Error type | Response type |
|---|---|
| Missing or empty mandatory parameter | 400 Bad Request |
| Invalid or unauthorized licence | 401 Unauthorized |
Example (400):
{
"status": 400,
"message": "Missing parameters",
"details": "FirstName",
"error": "bad request"
}
Example (401):
{
"status": 401,
"message": "Your licence is not allowed to cover this functionnality",
"details": "{WRONG LICENSE}",
"error": "unauthorized_client"
}