In this section, we are going to explain how to properly make validations using phone, the main logic that the service do is the following:
Request Phone Validation
First thing that you need to do is to request an OTP for email, this can be done using the service for Phone 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",
"phone": "3208364280",
"countryCode": "+57",
"type": "login",
"validationMethod": "whatsapp",
"language": "en"
}
Now we will explain each of these parameters 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.
- phone: Phone that will undergo validation; this phone must be real and have WhatsApp or SMS depending on how do you want to make the validation.
- countryCode: Country code prefix.
- 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, you can use “whatsapp” or “sms” as valid parameters, this depends on how you configure your projectFlow, 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 params are real and related, this means that the project contains this projectFlow.
- The phone is in your whitelist and have WhatsApp or SMS depending on how do you want to receive the OTP.