How sending OTP codes works
An OTP (One-Time Password) is a temporary code used to verify the identity of a user (login, registration, sensitive transaction, password reset).
Typical flow
- Your application requests an OTP code via the EnvoiSMS.ma API (
/otp/sendor via classic SMS/WhatsApp sending with an OTP model) - We generate and send the code by SMS and/or WhatsApp to the user's number, via priority direct routing
- The user enters the received code into your application
- Your application verifies the code via the API (
/otp/verify), which confirms its validity and invalidates it immediately after use
Code generation
You can either let EnvoiSMS.ma generate and validate the code for you (recommended, more secure), or generate the code yourself on the server side and simply send it like a classic SMS/WhatsApp.