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 HTTPPOST 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 uniquereferenceId.
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 aPOST request to the /api/v1/verify endpoint:
Next Steps
Congratulations! You’ve successfully integrated WhatsApp OTPs into your application.- To learn more about handling errors, read our Error Handling Guide.
- To customize the message template, check out the Templates documentation.