En Verifik usamos webhooks para notificar a nuestros clientes cada uno de los pasos que se realizaron durante el flujo de un proyecto. En esta guía nos enfocaremos en los eventos relacionados con SmartAccess, qué enviamos, en qué circunstancias enviamos los datos y ejemplos de una respuesta completa en cada caso.
A considerar:
Type: login_email_validation_created
Ocurre cuando alguien con un correo electrónico válido que proporcionas en tu lista blanca hace una solicitud de OTP. Ten en cuenta que el evento solo ocurrirá con correos electrónicos dentro de esta lista, otros correos no activarán este evento.
Endpoint que activará estos eventos: https://api.verifik.co/v2/email-validations
{
**"type": "login_email_validation_created",**
"object": {
"client": "613375a1eab2fe08527f81e2",
"project": "6266193db77ccc8111730c90",
"projectFlow": "658ed28b0990f300134d7b78",
"status": "sent",
"validationMethod": "verificationCode",
"email": "[[email protected]](<mailto:[email protected]>)",
"emailData": "[Object]",
"expiresAt": "2024-06-03T20:02:03.000Z",
"extraParams": [],
"type": "login",
"redirectUrl": "[<https://verifik.app>](<https://verifik.app/>)",
"requires2FA": false,
"ipAddress": "172.17.0.1",
"_id": "665e1ee3647e09c2e0cf74ce",
"updatedAt": "2024-06-03T19:52:03.861Z",
"createdAt": "2024-06-03T19:52:03.861Z",
"__v": 0
},
"ipAddress": "::ffff:127.0.0.1"
}
Type: login_email_validation_otp_resend
Ocurre cuando alguien solicita otro OTP mientras la sesión de validación aún está activa.
{
"_id": "6660cc0fe4b4a2f4eba7a062",
"client": "6158e492dd0767a2b8b3f829",
"project": "665f84855c61587599dc5b08",
"projectFlow": "665f84855c61587599dc5b0c",
"status": "sent",
"validationMethod": "verificationCode",
"email": "[email protected]",
"emailData": {
"firstName": "Nicolas",
"title": "Ejemplo bug 11",
"projectName": "Ejemplo bug 11",
"contactEmail": "",
"logo": "<https://cdn.verifik.co/projects/Ejemplobug11_1717535945780-image.png>"
},
"expiresAt": "2024-06-05T20:48:34.000Z",
"extraParams": [],
"type": "login",
"redirectUrl": "<https://verifik.co>",
"requires2FA": false,
"ipAddress": "4.246.194.90",
"updatedAt": "2024-06-05T20:38:34.417Z",
"createdAt": "2024-06-05T20:35:27.811Z",
"__v": 0
}
Type: login_email_validation_validated
Ocurre cuando alguien envía el OTP correcto durante el proceso de validación.
Endpoint que activará estos eventos: https://api.verifik.co/v2/email-validations/validate
{
**"type": "login_email_validation_validated",**
"object": {
"_id": "665e236ee1687449db011e1f",
"client": "613375a1eab2fe08527f81e2",
"project": "6266193db77ccc8111730c90",
"projectFlow": "658ed28b0990f300134d7b78",
"status": "validated",
"validationMethod": "verificationCode",
"email": "[[email protected]](<mailto:[email protected]>)",
"emailData": "[Object]",
"expiresAt": "2024-06-03T20:21:26.000Z",
"extraParams": [],
"type": "login",
"redirectUrl": "[<https://verifik.app>](<https://verifik.app/>)",
"requires2FA": false,
"ipAddress": "172.17.0.1",
"updatedAt": "2024-06-03T20:11:31.007Z",
"createdAt": "2024-06-03T20:11:26.861Z",
"__v": 0
},
"ipAddress": "::ffff:127.0.0.1"
}
Type: login_email_validation_otp_incorect
Ocurre cuando alguien envía un OTP incorrecto durante el proceso de validación.
{
"_id": "6660cc0fe4b4a2f4eba7a062",
"client": "6158e492dd0767a2b8b3f829",
"project": "665f84855c61587599dc5b08",
"projectFlow": "665f84855c61587599dc5b0c",
"status": "sent",
"validationMethod": "verificationCode",
"email": "[email protected]",
"emailData": {
"firstName": "Nicolas",
"title": "Ejemplo bug 11",
"projectName": "Ejemplo bug 11",
"contactEmail": "",
"logo": "<https://cdn.verifik.co/projects/Ejemplobug11_1717535945780-image.png>"
},
"otp": "$2a$10$/KWGsRHi3YLMblSQK6Er7OTEd3QRd0J4FGu3twl1N0ZzMETrUGLzi",
"expiresAt": "2024-06-05T20:45:27.000Z",
"extraParams": [],
"type": "login",
"redirectUrl": "<https://verifik.co>",
"requires2FA": false,
"ipAddress": "4.246.194.90",
"updatedAt": "2024-06-05T20:35:27.811Z",
"createdAt": "2024-06-05T20:35:27.811Z",
"__v": 0
}
Type: login_phone_validation_created
Ocurre cuando alguien con un número de teléfono válido que proporcionas en tu lista blanca hace una solicitud de OTP. Ten en cuenta que el evento solo ocurrirá con números de teléfono dentro de esta lista, otros números no activarán este evento.
Endpoint que activará estos eventos: https://api.verifik.co/v2/phone-validations
{
**"type": "login_phone_validation_created",**
"object": {
"client": "613375a1eab2fe08527f81e2",
"project": "6266193db77ccc8111730c90",
"projectFlow": "658ed28b0990f300134d7b78",
"status": "sent",
"countryCode": "+507",
"phone": "80930931",
"phoneGateway": "whatsapp",
"expiresAt": "2024-06-03T20:25:22.000Z",
"phoneData": "[Object]",
"type": "login",
"redirectUrl": "[<https://verifik.app>](<https://verifik.app/>)",
"requires2FA": false,
"ipAddress": "172.17.0.1",
"language": "en",
"_id": "665e245ae1687449db011eff",
"updatedAt": "2024-06-03T20:15:23.312Z",
"createdAt": "2024-06-03T20:15:23.312Z",
"__v": 0
},
"ipAddress": "::ffff:127.0.0.1"
}
Type: login_phone_validation_resend
Ocurre cuando alguien solicita otro OTP mientras la sesión de validación aún está activa.
{
"_id": "6660d0fcf6e7624798b3e757",
"client": "6158e492dd0767a2b8b3f829",
"project": "665f84855c61587599dc5b08",
"projectFlow": "665f84855c61587599dc5b0c",
"status": "sent",
"countryCode": "+57",
"phone": "3208364280",
"phoneGateway": "sms",
"otp": "$2a$10$W3t1JBs1DkUCfagW9WLrxeps4UZURiakwPoIBeL6bsrKaRHzCdt2O",
"expiresAt": "2024-06-05T21:10:15.000Z",
"phoneData": {
"title": "Ejemplo bug 11"
},
"type": "login",
"redirectUrl": "<https://verifik.co>",
"requires2FA": false,
"ipAddress": "4.246.194.90",
"language": "es",
"updatedAt": "2024-06-05T21:00:16.173Z",
"createdAt": "2024-06-05T20:56:29.760Z",
"__v": 0
}
Type: login_phone_validation_validated
Ocurre cuando alguien envía el OTP correcto durante el proceso de validación.
Endpoint que activará estos eventos: https://api.verifik.co/v2/phone-validations/validate
{
"**type": "login_phone_validation_validated",**
"object": {
"_id": "665e245ae1687449db011eff",
"client": "613375a1eab2fe08527f81e2",
"project": "6266193db77ccc8111730c90",
"projectFlow": "658ed28b0990f300134d7b78",
"status": "validated",
"countryCode": "+507",
"phone": "80930931",
"phoneGateway": "whatsapp",
"expiresAt": "2024-06-03T20:25:22.000Z",
"phoneData": "[Object]",
"type": "login",
"redirectUrl": "[<https://verifik.app>](<https://verifik.app/>)",
"requires2FA": false,
"ipAddress": "172.17.0.1",
"language": "en",
"updatedAt": "2024-06-03T20:18:48.933Z",
"createdAt": "2024-06-03T20:15:23.312Z",
"__v": 0
},
"ipAddress": "::ffff:127.0.0.1"
}
Type: login_phone_validation_otp_incorect
Ocurre cuando alguien envía un OTP incorrecto durante el proceso de validación.
{
"_id": "6660d0fcf6e7624798b3e757",
"client": "6158e492dd0767a2b8b3f829",
"project": "665f84855c61587599dc5b08",
"projectFlow": "665f84855c61587599dc5b0c",
"status": "sent",
"countryCode": "+57",
"phone": "3208364280",
"phoneGateway": "sms",
"otp": "$2a$10$Sq8gm6.GBcwglJRn6w8nBeGA59Uxxx4E7OaXRYJi6mOwu2nPE5gzi",
"expiresAt": "2024-06-05T21:06:28.000Z",
"phoneData": {
"title": "Ejemplo bug 11"
},
"type": "login",
"redirectUrl": "<https://verifik.co>",
"requires2FA": false,
"ipAddress": "4.246.194.90",
"language": "es",
"updatedAt": "2024-06-05T20:56:29.760Z",
"createdAt": "2024-06-05T20:56:29.760Z",
"__v": 0
}