Skip to content

SDK

C# SDK / HTTP client

Connect Cascade via HttpClient: send and verify OTP.

Quick Answer

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

Summary

Ready fragments for C#: 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 C# with the HttpClient client.

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

Installation

dotnet add package System.Net.Http.Json

An official Cascade NuGet package may not exist.

Init + send

using var http = new HttpClient { BaseAddress = new Uri("https://cascade.kz/api/") };
http.DefaultRequestHeaders.Authorization =
    new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("OTP_API_TOKEN"));
http.DefaultRequestHeaders.Accept.ParseAdd("application/json");

var send = await http.PostAsJsonAsync("otp/send", new { phone = "77001234567", purpose = "verification" });
var sendBody = await send.Content.ReadFromJsonAsync<JsonElement>();

Verify

var verify = await http.PostAsJsonAsync("otp/verify", new { phone = "77001234567", code = "482910", purpose = "verification" });

Check the success property. See API, documentation, use-cases.