Webhook Guide
Webhooks are a powerful mechanism for receiving real-time notifications about events occurring within the OTPLESS system. By integrating webhooks into your application, you can gain valuable insights into user authentication activities and system health, enabling efficient tracking and reporting.
Types of Webhooks
The OTPLESS system offers various webhooks to cater to different needs:
Message Delivery Event
Trigger when there is any change in the status of the message delivery on WhatsApp, SMS or Email.
System Events
Trigger when there is any system specific events.
Delivery Status Events
Webhooks can be leveraged to track the delivery status of authentication requests initiated via WhatsApp
.
Status Descriptions
The following statuses are delivered through webhooks for WhatsApp authentication:
SENT
: Indicates the message containing the authentication request has been sent to the recipient’s WhatsApp number.DELIVERED
: Confirms that the message has been successfully delivered to the recipient’s device.READ
: Indicates the recipient has read the message.FAILED
: Signifies that the message delivery has encountered an issue.
Sequence of Statuses
Ideally, the sequence of status updates follows the order: SENT -> DELIVERED -> READ
.
However, variations might occur depending on the recipient’s WhatsApp settings (e.g., read receipts disabled). If a later status is received, it implies all preceding statuses have been fulfilled.
Important Notes
- Webhooks for delivery status updates are not mandatory.
- The availability of status updates depends on the recipient’s WhatsApp settings.
- There might be instances where webhooks are missed due to technical issues on either side (client or server). The system implements retries to mitigate this.
Example Payloads
Here are JSON examples illustrating each status update for WhatsApp delivery:
errorCode | errorMessage | Retriable |
---|---|---|
00a | Others - Unknown | Yes |
003 | - Unknown Subscriber - Other Delivery Failure | No |
024 | Others - Undelivered | Yes |
033 | Mobile Number not OPT-IN | Can be retried after OPT-IN |
101 | 24HR_TimeExceed | No |
103 | WhatsApp_Failed | Have to check the reason from meta on case by case basis. |
System Events
In addition to delivery status updates, OTPLESS offers webhooks for specific system events:
This webhook is triggered when a user clicks the Approve
button or the magic link on WhatsApp/SMS/Email during the authentication process.
Payload
The payload associated with this webhook provides the following information:
- token (string): Unique identifier for the request.
- timestamp (string): Date and time of the event in ISO 8601 format.
- mobile (object): Contains the user’s mobile number.
- number (string): User’s phone number.
- requestId (string): Unique identifier for the authentication request.
- notificationType (string): Always “APPROVAL_ACTION” for this webhook.
Example Payload
How to Configure Webhook URL?
Login to OTPLESS Dashboard
Access the OTPLESS dashboard using your registered work email address.
Choose the App
- In the top left navigation panel, locate the list of applications you have access to within OTPLESS. - Select the specific application for which you want to configure the webhook URL.
Go to connectors
- Navigate to the
Connectors
section from the left navigation bar. - Within Connectors, locate and select theWebhook
option. - On the Webhook configuration page, you will find a designated field toenter the URL
where you want to receive webhook notifications for the chosen application. - Enter your desired webhook URL in the designated field. - You can also configure which specific events (e.g., Delivery Status Events, OTPLESS System Events) should trigger webhooks by selecting them from the available options. - Once you’ve entered the URL and selected the desired events, save your configuration changes.
Ensure the provided webhook URL is publicly accessible and can handle GET/POST requests from the OTPLESS system.
Was this page helpful?