Skip to content

API

Examples

Copy the curl and paste your Bearer token.

Quick Answer

Export OTP_API_TOKEN and call /otp/send, then /otp/verify.

Summary

A set of minimal working examples for a quick start in ~3 minutes.

Key Takeaways

  • Always Accept: application/json.
  • Normalize the phone to digits.
  • More examples in /sdk.

Contents

  1. Env
  2. Send
  3. Verify
  4. Shorten

Env

export OTP_API_TOKEN='your_key'

Send

curl -sS -X POST "https://cascade.kz/api/otp/send" \
  -H "Authorization: Bearer $OTP_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"phone":"77001234567","purpose":"login","channel":"whatsapp"}'

Verify

curl -sS -X POST "https://cascade.kz/api/otp/verify" \
  -H "Authorization: Bearer $OTP_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"phone":"77001234567","code":"123456","purpose":"login"}'

Shorten

curl -sS -X POST "https://cascade.kz/api/links/shorten" \
  -H "Authorization: Bearer $OTP_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/path","expires_in":3600}'

See SDK, documentation, FAQ, use-cases.