In this section, we are going to explain how to properly make validations using mails, the main logic that the service do is the following:
Request Email Validation
First thing that you need to do is to request an OTP for email, this can be done using the service for **Email validation request,** this is a POST method in which you send some configuration information, this to allow the Email to go correctly to someone in your whitelist, this is an example of the information that you must provide in the Body:
{
"project": "6266193db77ccc8111730c90",
"projectFlow": "658ed28b0990f300134d7b78",
"email": "[email protected]",
"type": "login",
"validationMethod": "verificationCode",
"language": "en"
}
Now we will explain each of these params and how to send them properly in the request of the API:
- project: Project ID, obtained when generating a project successfully.
- projectFlow: Project flow ID, obtained when creating a project flow successfully.
- email: Email that will undergo validation; this email must be real and have an active inbox.
- type: Type of process to be carried out; the following options are available “login” or “onboarding”, The type must match the one established in the project flow.
- validationMethod: Validation method; currently, the "verificationCode" parameter is used, which generates a One Time Password (OTP) for this process.
- language: Language in which the verification email will be sent; this parameter consists of language abbreviations, for example, "es" for Spanish and "en" for English.
Success Criteria
For the service to work correctly, you need to have the following information correctly:
- project and projectFlow parameters are real and related, this means that the project contains this projectFlow.
- The email is in your whitelist and have an inbox.
- type must be “login”, other types don’t work for Smart Access and the system will fail.