Actions42
- Message Actions
- Chat Actions
- Account Actions
- Campaign Actions
- Contact Actions
- Group Actions
- OTP Actions
- SMS Actions
- Validation Actions
Overview
The node provides functionality to send a one-time-password (OTP) message via SMS or WhatsApp using the Zender API. It supports sending OTPs with customizable messages, expiration times, and additional options such as message priority or sending mode. This node is useful in scenarios where you need to implement two-factor authentication, password resets, or any verification process requiring temporary codes sent to users' mobile devices.
For example, you can use this node to:
- Send an OTP via SMS to verify a user's phone number during registration.
- Deliver an OTP through WhatsApp for secure login confirmation.
- Customize the OTP message content and expiration time according to your security policies.
Properties
| Name | Meaning |
|---|---|
| Type | Type of message for OTP: SMS or WhatsApp. |
| Phone Number | Recipient mobile number in E.164 format (e.g., +1234567890). |
| Message | OTP message text to send; supports {{otp}} shortcode to insert the generated OTP code. |
| Expire Time (seconds) | Duration in seconds before the OTP expires (e.g., 300 seconds = 5 minutes). |
| WhatsApp Account ID | (WhatsApp only) The WhatsApp account identifier used to send the OTP. |
| Additional Fields | Collection of extra options depending on the OTP type: |
- For WhatsApp: Priority (High (Send Immediately) or Normal). |
|
- For SMS: Mode (Devices or Credits), Device ID (if mode is Devices), Gateway ID (if Credits), SIM Slot (1 or 2). |
Output
The node outputs a JSON object containing the response from the Zender API after attempting to send the OTP. This typically includes status information about the request, such as success confirmation, message IDs, or error details if the request failed.
No binary data output is produced by this operation.
Example output JSON structure (simplified):
{
"status": "success",
"messageId": "abc123",
"details": { ... }
}
Dependencies
- Requires an API key credential for authenticating with the Zender API.
- The node makes HTTP POST requests to the Zender API endpoint
/send/otp. - No additional environment variables are required beyond the configured API credentials.
Troubleshooting
- Invalid phone number format: Ensure the phone number is in E.164 format (e.g., +1234567890). Incorrect formatting will cause the API to reject the request.
- Missing or invalid API key: The node requires a valid API key credential. Verify that the credential is correctly set up in n8n.
- Incorrect WhatsApp Account ID: When sending OTP via WhatsApp, ensure the account ID is valid and linked to your Zender account.
- Message template errors: The OTP message must include the
{{otp}}placeholder to insert the generated OTP code. Omitting it may result in incorrect messages. - Mode and device/gateway mismatch: For SMS OTPs, selecting the correct mode (
DevicesorCredits) and providing corresponding device or gateway IDs is necessary. - API request failures: Network issues or API downtime can cause errors. Check connectivity and Zender service status.
If the node encounters an error and "Continue On Fail" is enabled, it will output the error message in the JSON field for the respective item.
Links and References
- Zender API Documentation (general reference for API endpoints)
- E.164 Phone Number Format
- Two-Factor Authentication (2FA) Concepts