RCSZilla Version 1.0

OTP-Verifizierungs-API

Integrationsleitfaden für mobile App

Senden Sie Einmalpasswörter per SMS oder E-Mail und verifizieren Sie sie aus jeder Anwendung.

*
Dieser Endpunkt erfordert ein Bearer-Token oder X-API-Token — generieren Sie einen API-Schlüssel unter Einstellungen → API-Schlüssel.

OTP senden

POST /api/?endpoint=send_otp

Generiert einen Code, sendet ihn an den Empfänger und protokolliert den Versuch. Auf einen Versand pro 60 Sekunden pro Empfänger begrenzt.

Anfragekörper

Feld Typ Beschreibung
recipient string erforderlich Telefonnummer (E.164-Format) oder E-Mail-Adresse.
channel string optional "sms" oder "email". Standard: in den OTP-Einstellungen konfigurierter Kanal.
lang string optional Vorlagen-Sprachcode: en, ro, bg, fr, de, uk. Standard "en".
ref_id string optional Ihre optionale Referenz (Bestell-ID, Session-ID…) — wird in der Verifizierungsantwort zurückgegeben.

Beispielanfrage

cURL
curl -X POST "https://api.rcszilla.com/api/?endpoint=send_otp" \
  -H "Authorization: Bearer YOUR-API-TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipient":"+40700000000","channel":"sms","lang":"en","ref_id":"order_42"}'
PHP
$ch = curl_init('https://api.rcszilla.com/api/?endpoint=send_otp');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => json_encode([
        'recipient' => '+40700000000',
        'channel'   => 'sms',
        'lang'      => 'en',
        'ref_id'    => 'order_42',
    ]),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer YOUR-API-TOKEN', 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
// $result = ['success' => true, 'otp_id' => 42]
Python
import requests

r = requests.post(
    "https://api.rcszilla.com/api/",
    params={"endpoint": "send_otp"},
    json={"recipient": "+40700000000", "channel": "sms", "lang": "en", "ref_id": "order_42"},
    headers={"Authorization": "Bearer YOUR-API-TOKEN"},
    timeout=10,
)
print(r.json())  # {'success': True, 'otp_id': 42}
Node.js
const res = await fetch("https://api.rcszilla.com/api/?endpoint=send_otp", {
  method: "POST",
  headers: { "Authorization": "Bearer YOUR-API-TOKEN", "Content-Type": "application/json" },
  body: JSON.stringify({ recipient: "+40700000000", channel: "sms", lang: "en", ref_id: "order_42" }),
});
const data = await res.json();
// data = { success: true, otp_id: 42 }
Ruby
require 'net/http'; require 'json'
uri = URI("https://api.rcszilla.com/api/?endpoint=send_otp")
req = Net::HTTP::Post.new(uri, 'Authorization' => 'Bearer YOUR-API-TOKEN', 'Content-Type' => 'application/json')
req.body = {recipient: '+40700000000', channel: 'sms', lang: 'en'}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |h| h.request(req) }
puts JSON.parse(res.body)
Go
payload, _ := json.Marshal(map[string]string{"recipient": "+40700000000", "channel": "sms", "lang": "en"})
req, _ := http.NewRequest("POST", "https://api.rcszilla.com/api/?endpoint=send_otp", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR-API-TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
// read resp.Body...
Java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.rcszilla.com/api/?endpoint=send_otp"))
    .header("Authorization", "Bearer YOUR-API-TOKEN")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(
        "{\"recipient\":\"+40700000000\",\"channel\":\"sms\",\"lang\":\"en\"}"
    ))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
// parse response.body() as JSON

Antwort

JSON200 OK
{
  "success": true,
  "message": "OTP sent.",
  "otp_id": 42
}
JSON429 Rate Limited
{
  "success": false,
  "message": "Please wait 45 seconds before requesting a new code.",
  "retry_after": 45
}

OTP verifizieren

POST /api/?endpoint=verify_otp

Prüft den übermittelten Code gegen das zuletzt ausstehende OTP für diesen Empfänger.

Anfragekörper

Feld Typ Beschreibung
recipient string erforderlich Dieselbe Telefonnummer/E-Mail wie beim Senden.
code string erforderlich Der vom Benutzer eingegebene Code.

Beispielanfrage

cURL
curl -X POST "https://api.rcszilla.com/api/?endpoint=verify_otp" \
  -H "Authorization: Bearer YOUR-API-TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipient":"+40700000000","code":"123456"}'
PHP
$ch = curl_init('https://api.rcszilla.com/api/?endpoint=verify_otp');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => json_encode(['recipient' => '+40700000000', 'code' => '123456']),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['Authorization: Bearer YOUR-API-TOKEN', 'Content-Type: application/json'],
]);
$result = json_decode(curl_exec($ch), true);
if ($result['success']) {
    // phone verified — proceed with user action
}
Python
r = requests.post(
    "https://api.rcszilla.com/api/",
    params={"endpoint": "verify_otp"},
    json={"recipient": "+40700000000", "code": "123456"},
    headers={"Authorization": "Bearer YOUR-API-TOKEN"},
)
if r.json().get("success"):
    pass  # verified — continue
Node.js
const res = await fetch("https://api.rcszilla.com/api/?endpoint=verify_otp", {
  method: "POST",
  headers: { "Authorization": "Bearer YOUR-API-TOKEN", "Content-Type": "application/json" },
  body: JSON.stringify({ recipient: "+40700000000", code: "123456" }),
});
const { success, message, otp_id, ref_id, verified_at } = await res.json();
Ruby
require 'net/http'; require 'json'
uri = URI("https://api.rcszilla.com/api/?endpoint=verify_otp")
req = Net::HTTP::Post.new(uri, 'Authorization' => 'Bearer YOUR-API-TOKEN', 'Content-Type' => 'application/json')
req.body = {recipient: '+40700000000', code: '123456'}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') { |h| h.request(req) }
puts JSON.parse(res.body)
Go
payload, _ := json.Marshal(map[string]string{"recipient": "+40700000000", "code": "123456"})
req, _ := http.NewRequest("POST", "https://api.rcszilla.com/api/?endpoint=verify_otp", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR-API-TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
// read resp.Body...

Antwort

JSON200 OK
{
  "success": true,
  "message": "OTP verified successfully.",
  "otp_id": 42,
  "ref_id": "order_42",
  "verified_at": "2026-05-05T14:30:00+00:00"
}
JSON422 Wrong Code
{
  "success": false,
  "message": "Wrong code. 2 attempt(s) remaining.",
  "attempts_remaining": 2
}

Fehlercodes

HTTP Beschreibung
400Ungültige Anfrage oder unbekannte Aktion.
401Ungültiges oder fehlendes API-Token.
403Zu viele falsche Versuche — OTP ungültig.
404Kein aktives OTP für diesen Empfänger gefunden.
410OTP ist abgelaufen.
422Falscher Code — Antwort enthält attempts_remaining.
429Ratenbegrenzung — Antwort enthält retry_after (Sekunden).
500Zustellfehler — überprüfen Sie Ihre Kanaleinstellungen.