Skip to content

SDK

Cascade OTP in Rust

Connect Cascade via reqwest: send and verify OTP.

Cascade provides a REST API. Below is a practical minimum in Rust with the reqwest client.

Useful links: API, send, verify, examples, FAQ, pricing, documentation.

Installation

[dependencies]
reqwest = { version = "0.12", features = ["json"] }
serde_json = "1"
tokio = { version = "1", features = ["full"] }

An official Cascade crate may not exist.

Example

let client = reqwest::Client::new();
let token = std::env::var("OTP_API_TOKEN")?;
let send: serde_json::Value = client
  .post("https://cascade.kz/api/otp/send")
  .bearer_auth(&token)
  .json(&serde_json::json!({"phone":"77001234567","purpose":"verification"}))
  .send().await?.json().await?;
assert_eq!(send["success"], true);

Similarly for /otp/verify. Handle network errors and success=false. See errors, FAQ, sdk.