Skip to main content
Sending OTPs over WhatsApp is significantly faster and more reliable than traditional SMS, and OTP Edge makes it incredibly simple. In this tutorial, we will walk through how to send your very first WhatsApp OTP using our REST API.

Prerequisites

Before you start, ensure you have the following:
  • An OTP Edge Account. If you don’t have one, sign up here.
  • Your API Key. You can generate one in the Dashboard.

Step 1: The Request

To send a WhatsApp OTP, you simply need to make an HTTP POST request to the /api/v1/send-otp endpoint. Here is an example using cURL:

Parameters

Step 2: The Response

If the request is successful, OTP Edge will immediately dispatch the WhatsApp message via the Meta API and return a JSON response containing a unique referenceId.
Note: You must store this referenceId. You will need it in the next step to verify the OTP!

Step 3: Verifying the OTP

Once the user receives the OTP on WhatsApp and types it into your application, you need to verify it. Make a POST request to the /api/v1/verify endpoint:
If the code matches, you will receive a success response:

Next Steps

Congratulations! You’ve successfully integrated WhatsApp OTPs into your application.