Validar la validación de correo electrónico

Endpoint

POST /v2/email-validations/validate

Descripción Este endpoint valida una contraseña de un solo uso (OTP) enviada a la dirección de correo electrónico del usuario como parte del proceso de verificación de correo. Garantiza que el OTP proporcionado por el usuario sea correcto y vincula el estado de verificación al usuario.

Headers

Header
Type
Required
Description

Content-Type

String

Yes

Set to application/json.

Authorization

String

Yes

Bearer token for API authorization.

Body Parameters

Parameter
Type
Required
Description

project

String

Yes

Unique identifier for the project.

projectFlow

String

Yes

Identifier for the specific project flow.

email

String

Yes

Email address of the user to validate.

validationMethod

String

Yes

The validation method, set to verificationCode.

type

String

Yes

Type of validation, e.g., login.

otp

String

Yes

The one-time password provided by the user.

Request

const axios = require('axios');

let data = JSON.stringify({
  "project": "6266193db77ccc8111730c90",
  "projectFlow": "65bed28b0990f300134d7b78",
  "email": "[email protected]",
  "validationMethod": "verificationCode",
  "type": "login",
  "otp": "884632"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://app.verifik/v2/email-validations/validate',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer <your-token>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

Response

{
  "email": "[email protected]",
  "type": "login",
  "showFaceLivenessRecommendation": true,
  "appLogin": {
    "_id": "674ddbf121c72be3cc42b884",
    "client": "613375a1eab2fe08527f81e2",
    "name": "JORGE ELIECER REINA SANCHEZ",
    "status": "validated",
    "project": "6266193db77ccc8112730c90",
    "projectFlow": "65bed28b0990f310134d7b78",
    "type": "email",
    "emailValidation": "674ddbf121c72be3cc42b882",
    "updatedAt": "2024-12-02T16:10:58.161Z",
    "createdAt": "2024-12-02T16:10:25.151Z"
  },
  "token": "eyJhbGciOiJIUzI1..."
}

Response Body

Parameter
Type
Description

email

String

Email address that was validated.

type

String

Validation type, e.g., login.

showFaceLivenessRecommendation

Boolean

Indicates if face liveness check is recommended.

appLogin

Object

Contains detailed information about the validated login session.

appLogin._id

String

Unique ID of the login session.

appLogin.name

String

Name of the user.

appLogin.status

String

Status of the validation, e.g., validated.

token

String

JWT token generated after successful validation.

Notas

  • El OTP debe generarse previamente y enviarse al correo electrónico del usuario.

  • Asegúrate de que tu aplicación maneje los tokens JWT de manera segura después de la validación.

  • Si se recomienda la verificación de liveness facial, guía a los usuarios para completar este paso en tu flujo.

Last updated