Quick answer
To send OTPs, register an OTP template on DLT, then call the SMS API from your server each time a user needs a code.
Steps
- Register an OTP template, for example: {#var#} is your OTP to log in to BrandName. Valid for 10 minutes. Do not share it. - BRAND
- Generate the OTP on your server, not in the app or browser.
- Call the API with the number, sender ID, template and message.
- Store the OTP securely with an expiry time, and verify what the user enters.
Security tips
- Never send the API key to the browser or mobile app. Call the API from your server.
- Limit how many OTPs one number or IP can request in a few minutes.
- Let OTPs expire after a few minutes, and allow a resend only after a short wait.
See OTP message formats and the SMS API page.
Was this answer helpful?Still have a question? Contact our team or WhatsApp us.
