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 delivery reports, enabling efficient tracking and reporting.
Types of Webhooks
The OTPLESS system offers various webhooks to cater to different needs:
Message Delivery Events
Trigger an event whenever there is a change in the delivery status of a message sent via WhatsApp, SMS, Viber or Email.
Auth Events
Trigger when there is any auth specific events.
Message Delivery 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:
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:
Similar to WhatsApp, webhooks can be used to track the delivery status of SMS-based authentication requests.
Status Descriptions
The following statuses are delivered through webhooks for SMS authentication:
DELIVERED
: Confirms that the message containing the authentication request has been successfully delivered to the recipient’s device.FAILED
: Signifies that the message delivery has encountered an issue.
Example Payloads
Here are JSON examples illustrating each status update for SMS delivery:
Webhooks can be leveraged to track the delivery status of authentication requests initiated via Viber
.
Status Descriptions
The following statuses are delivered through webhooks for Viber authentication:
SENT
: Indicates the message containing the authentication request has been sent to the recipient’s Viber 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 Viber 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 Viber 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 Viber delivery:
Webhooks can be leveraged to track the delivery status of authentication requests initiated via Email
.
Status Descriptions
The following statuses are delivered through webhooks for Email authentication:
SENT
: Indicates the email containing the authentication request has been sent to the recipient’s email address.DELIVERED
: Confirms that the email has been successfully delivered to the recipient’s mailbox.READ
: Indicates the recipient has opened the email. (Note: This status is available only with specific email vendors that support read tracking.)FAILED
: Signifies that the email 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 email client and settings (e.g., email tracking 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 email client and settings.
- The
READ
event works only with specific vendors that support read tracking. - 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 Email delivery:
Clicked Status Events
The CLICKED
event for WhatsApp indicates that the recipient has clicked on the authentication link sent via WhatsApp.
Example Payload
The CLICKED
event for WhatsApp indicates that the recipient has clicked on the authentication link sent via WhatsApp.
Example Payload
The CLICKED
event for SMS indicates that the recipient has clicked on the authentication link sent via SMS.
Example Payload
The CLICKED
event for Viber indicates that the recipient has clicked on the authentication link sent via Viber.
Example Payload
Auth Events
In addition to authentication, OTPLESS offers webhooks for specific auth events for fallback(in case of Smart Auth
) and on authentication completion:
Authentication Completion Events
The AUTH
event is triggered upon successful authentication using both a phone number and an email address.
Example Payload
Fallback Events
The AUTH
event is triggered when a fallback occurs from one channel to another.
Example Payload
Important Notes
- Possible channels could be
WHATSAPP
,SMS
,VIBER
.
Was this page helpful?