Parameters
Validate the code
Common failure reasons
- Code does not match the active OTP
- Code expired based on
expiresvalue - Code already used (single-use)
- No active OTP found for the
chatId
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Confirm a user’s OTP submission from Laravel.
| Field | Type | Required | Description |
|---|---|---|---|
| chatId | string | yes | WhatsApp chat ID that received the OTP. |
| code | string | yes | The OTP code entered by the user. |
use Hypersender\Hypersender;
$response = Hypersender::otp()->validateCode([
'chatId' => '[email protected]',
'code' => '439713',
]);
if (($response['success'] ?? false) && (($response['data']['status'] ?? '') === 'validated')) {
// proceed with login or protected action
}
expires valuechatId