01 / Create an application
Open the dashboard, create an application, and generate an API key. Store the key on your server.
Connect your backend to WhatsApp and email verification. Start with the application, then follow the request through its lifecycle.
Open the dashboard, create an application, and generate an API key. Store the key on your server.
Set up the provider and templates for email or WhatsApp. Verify the configuration before sending production traffic.
Use sendOTP, verifyOTP, and resendOTP. Follow the reference for errors and configure webhooks where useful.
Replace the sample template key and locale with those of your approved WhatsApp authentication template. The expiry can be set from 60 to 600 seconds. The application name and support number are optional and used by compatible templates.
curl --request POST 'https://api.otpwire.com/api/sdk/v1/sendOTP' \
--header 'X-API-Key: YOUR_SERVER_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"channel": "whatsapp",
"recipient": "YOUR_WHATSAPP_NUMBER_IN_E164",
"purpose": "login",
"number_of_digits": 6,
"otp_format": "numeric",
"expiry_seconds": 300,
"locale": "en",
"template_key": "default_whatsapp_otp",
"metadata": {
"app_name": "My Store",
"support_number": "YOUR_SUPPORT_NUMBER_IN_E164"
}
}'
Use the same application key, the request_id returned by sendOTP, and the code received by the user. Check that the response contains verified set to true.
curl --request POST 'https://api.otpwire.com/api/sdk/v1/verifyOTP' \
--header 'X-API-Key: YOUR_SERVER_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"request_id": "REQUEST_ID_FROM_SEND",
"otp": "CODE_RECEIVED"
}'
Bring WhatsApp and email verification into your product. We’ll help you find the right starting point.