Skip to content

SDK

PHP SDK / HTTP client

Connect Cascade via cURL / Laravel Http: send and verify OTP.

Quick Answer

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

Summary

Ready fragments for PHP: 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 PHP with the cURL / Laravel Http client.

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

Installation

An official Composer package may not exist. In Laravel use the Http facade; in plain PHP — cURL.

# Laravel already includes an HTTP client

Laravel client (fragment)

Http::withToken($token)
    ->acceptJson()
    ->post('https://cascade.kz/api/otp/send', [
        'phone' => '77001234567',
        'purpose' => 'verification',
    ])->json();

cURL

$ch = curl_init('https://cascade.kz/api/otp/verify');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.$token,
        'Content-Type: application/json',
        'Accept: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'phone' => '77001234567',
        'code' => '482910',
        'purpose' => 'verification',
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$body = json_decode(curl_exec($ch), true);

See documentation, send-otp, FAQ.