Send and verify an OTP
Before you start
Request a code server-side and associate the verification ID with the user session. Reuse it for verification and resend.
Required. Send the account API key in the X-API-Key header. Never expose the key in a public browser or git repository.
- POST /api/v2/verification/send with to (optional channel=int_sms).
- Store verificationId in the user session.
- After the user types the code: POST /api/v2/verification/verify.
- If the code does not arrive, wait for resendAvailableAt then call /resend.
cURL
curl --request POST 'https://raselsms.com/api/v2/verification/send' \ -H "X-API-Key: $RASEL_API_KEY" \ -H 'Content-Type: application/json' \ --data-binary @- <<'RASEL_JSON'{ "to": "+963912345678", "channel": "int_sms"}RASEL_JSONTest locally with a mock response first. Confirm the recipient and cost before sending a live request.