Auto
EN

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.

  1. POST /api/v2/verification/send with to (optional channel=int_sms).
  2. Store verificationId in the user session.
  3. After the user types the code: POST /api/v2/verification/verify.
  4. 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_JSON

Test locally with a mock response first. Confirm the recipient and cost before sending a live request.