Zum Inhalt springen

POST /api/qr/generate

Erzeugt einen QR-Code aus einer expliziten Konfiguration. Das ist der zentrale Render-Endpunkt – sowohl die Editor-Oberfläche als auch der KI-Endpunkt münden hier.

Anfrage

Content-Type: application/json oder multipart/form-data (für binäre Logo-/Hintergrund-Uploads).

Body-Struktur: ein QrConfig-Objekt.

Minimales Beispiel:

curl -X POST https://api.qr-branding.com/api/qr/generate \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Proxy-Secret: <secret>" \
  -d '{
    "content": "https://yourbrand.com",
    "primaryColor": "#dcc28a",
    "backgroundColor": "#0a0b0e",
    "eccLevel": "H",
    "fileFormat": "png",
    "outputWidth": 800
  }'

Multipart-Upload (Logo als Datei)

curl -X POST https://api.qr-branding.com/api/qr/generate \
  -H "X-RapidAPI-Proxy-Secret: <secret>" \
  -F 'config={"content":"https://yourbrand.com","logoSizePercent":18,"eccLevel":"H"}' \
  -F "logoFile=@./brand-mark.png"

Das Feld config ist ein JSON-codierter String. logoFile und backgroundFile sind binäre Teile (PNG / JPG / GIF / BMP / WebP bis 10 MB).

Antwort (base64-Modus – Standard)

{
  "success": true,
  "qrBase64": "iVBORw0KGgoAAAANSUhEUgAA…",
  "format": "png",
  "contentType": "image/png",
  "sizeBytes": 38291
}

Antwort (Binärmodus)

{ "responseType": "binary" }

Gibt die rohen Dateibytes mit passendem Content-Type und Content-Disposition: attachment; filename="qrcode.png" zurück.

Validierung

Die Engine durchläuft die komplette Pipeline der Scan-Garantie. Häufige Ablehnungsgründe:

CodeBedeutungLösung
CONTENT_TOO_LONGCodierter String > 4296 ZeichenKürzen / einen URL-Kürzer nutzen
LOW_CONTRASTVordergrund vs. Hintergrund < 4:1Dunkleren Vorder- oder helleren Hintergrund wählen
LOGO_TOO_LARGElogoSizePercent > 25 bei ECC < HAuf H erhöhen oder das Logo verkleinern
INVALID_HEXFarbwert nicht #RGB, #RRGGBB, #RRGGBBAAFarbe korrigieren
INVALID_LLM_MODELNur beim KI-EndpunktSiehe KI-Modus

Siehe auch