Types of Webhooks

The OTPLESS system offers various webhooks to cater to different needs:

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:

{
"status": "SENT",
"data": {
    "referenceId": "580884110b1b46668baa1d46a65f46d9",
    "timestamp": 1707743465000,
    "identity": "919899038845",
    "channel": "WHATSAPP"
}
}
errorCodeerrorMessageRetriable
00aOthers - UnknownYes
003- Unknown Subscriber
- Other Delivery Failure
No
024Others - UndeliveredYes
033Mobile Number not OPT-INCan be retried after OPT-IN
10124HR_TimeExceedNo
103WhatsApp_FailedHave 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

{
  "token": "580884110b1b46668baa1d46a65f46d9",
  "timestamp": 1707743479000,
  "mobile": {
  "number": "919899038845"
  },
  "requestId": "580884110b1b46668baa1d46a65f46d9",
  "notificationType": "APPROVAL_ACTION"
}

How to Configure Webhook URL?

1

Login to OTPLESS Dashboard

Access the OTPLESS dashboard using your registered work email address.

2

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.
3

Go to connectors

  • Navigate to the Connectors section from the left navigation bar.
  • Within Connectors, locate and select the Webhook option.
  • On the Webhook configuration page, you will find a designated field to enter 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.