Skip to content

SDK

Rust SDK / HTTP client

Connect Cascade via reqwest: send and verify OTP.

Quick Answer

Call https://cascade.kz/api with a Bearer token from Rust on the backend.

Summary

Ready fragments for Rust: set up an HTTP client, initialize Bearer, send, verify, handle errors. An official package may be missing.

Key Takeaways

  • An official package is not required — HTTP is enough.
  • Server-side calls only.
  • Check success in JSON.

Related Questions

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.