Set up two-factor authentication (2FA) with EnvoiSMS.ma
Integration steps
- Retrieve your API key in Settings > API
- Call the OTP sending endpoint specifying the number, the channel (SMS, WhatsApp, or both with fallback), and possibly the length/validity period of the code
- On user input, call the verification endpoint with the entered code
- If successful, your application authorizes the connection or transaction; in case of failure, display an error message and offer a resend (with throttling)
Example of usage scenarios
- Login to a user account from a new device
- Confirmation of a bank transaction or payment
- Password reset
- Validation of a registration (real telephone number)
See the full API documentation (API category and technical documentation) for code examples by language.