Functionalities
OTP Code
Secure one-time password authentication via WhatsApp
Overview
The OTP Code feature allows you to implement secure one-time password authentication through WhatsApp. This provides a familiar and secure way for users to verify their identity during login, registration, or sensitive operations.
How It Works
- Your application requests an OTP code to be sent to a user’s WhatsApp
- CrunchzApp generates a random code and delivers it via WhatsApp
- The user enters this code in your application
- Your application validates the code through the CrunchzApp API
Available Methods
Request Code
Send a one-time password to a WhatsApp contact.
By default, OTP codes expire after 5 minutes. The user will receive a message containing the generated code.
Validate Code
Verify an OTP code entered by the user.
Parameter | Type | Required | Description |
---|---|---|---|
contact | string | Yes | The WhatsApp contact ID in the format ‘xxx@c.us’ |
code | string | Yes | The OTP code entered by the user |
OTP codes can only be validated once. After successful validation or expiration, a new code must be requested.