Skip to content

QR kodu API

Pārskats

Codes API ir qr3.app sirds. Ar to jūs varat izveidot, atjaunināt un dzēst dinamiskos un statiskos QR kodus.

Bāzes URL: https://qr3.app/v1/codes

QR koda izveide

POST /v1/codes

Terminal window
curl -X POST https://qr3.app/v1/codes \
-H "Authorization: Bearer qr3_sk_..." \
-H "Content-Type: application/json" \
-d '{
"type": "url",
"url": "https://example.com",
"title": "Mein erster QR-Code",
"tags": ["marketing", "q1"],
"is_dynamic": true
}'

Atbilde (HTTP 201):

{
"data": {
"id": "qr_a1b2c3d4",
"short_code": "r7f3Kx",
"redirect_url": "https://qr3.app/r7f3Kx",
"image_svg_url": "https://qr3.app/v1/codes/r7f3Kx/qr.svg",
"image_png_url": "https://qr3.app/v1/codes/r7f3Kx/qr.png",
"image_pdf_url": "https://qr3.app/v1/codes/r7f3Kx/qr.pdf",
"image_eps_url": "https://qr3.app/v1/codes/r7f3Kx/qr.eps",
"type": "url",
"target_url": "https://example.com",
"is_dynamic": true,
"status": "live",
"tags": ["marketing", "q1"],
"total_scans": 0,
"created_at": "2026-03-15T10:00:00.000Z"
},
"meta": { "request_id": "req_xyz123" }
}

QR kodu veidi

VeidsAprakstsObligātie lauki
urlMājaslapas URL (dinamisks vai statisks)url
vcardVizītkarte (vCard 3.0)vcard_first_name vai vcard_last_name
wifiWi-Fi konfigurācijawifi_ssid
emailE-pasts (mailto:)email_to
smsSMSsms_phone
locationAtrašanās vieta (geo:)location_lat, location_lng

A/B testēšana

Testējiet divus dažādus mērķa URL ar svērto novirzīšanu:

{
"type": "url",
"url": "https://version-a.example.com",
"ab_enabled": true,
"ab_target_url_b": "https://version-b.example.com",
"ab_weight_a": 50
}

Derīguma termiņš (Expiry)

QR kodu derīguma termiņš var beigties automātiski:

{
"type": "url",
"url": "https://aktionsseite.example.com",
"expires_at": "2026-12-31T23:59:59Z",
"redirect_after_expiry": "https://archiv.example.com"
}

Pēc derīguma termiņa beigām notiek novirzīšana uz redirect_after_expiry vai tiek parādīta 410 kļūdas lapa.


Masveida izveide (Batch)

POST /v1/codes/batch

Izveido līdz pat 1000 QR kodiem vienā pieprasījumā. Ideāli piemērots masveida lietojumiem.

Terminal window
curl -X POST https://qr3.app/v1/codes/batch \
-H "Authorization: Bearer qr3_sk_..." \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "type": "url", "url": "https://produkt-1.example.com", "tags": ["batch"] },
{ "type": "url", "url": "https://produkt-2.example.com", "tags": ["batch"] },
{ "type": "wifi", "wifi_ssid": "GastWLAN", "wifi_password": "geheim123" }
],
"skip_url_scan": false
}'

Atbilde (HTTP 201):

{
"data": {
"created": [
{ "id": "qr_...", "short_code": "abc123", "redirect_url": "https://qr3.app/abc123" },
{ "id": "qr_...", "short_code": "def456", "redirect_url": "https://qr3.app/def456" },
{ "id": "qr_...", "short_code": "ghi789", "status": "live" }
],
"total": 3,
"failed": 0
}
}

QR kodu saraksts

GET /v1/codes

Terminal window
curl https://qr3.app/v1/codes?status=live&limit=20 \
-H "Authorization: Bearer qr3_sk_..."

Vaicājuma parametri (Query parameters):

ParametrsTipsNoklusējumsApraksts
cursorstringKursors lapošanai (pagination)
limitinteger20Rezultātu skaits lapā (maks. 100)
statusstringFiltrs: live, paused, flagged, draft

QR koda iegūšana

GET /v1/codes/:id

Terminal window
curl https://qr3.app/v1/codes/qr_a1b2c3d4 \
-H "Authorization: Bearer qr3_sk_..."

QR koda atjaunināšana

PATCH /v1/codes/:id

Dinamiskie QR kodi ļauj jebkurā laikā mainīt mērķa URL — bez nepieciešamības vēlreiz drukāt QR kodu.

Terminal window
curl -X PATCH https://qr3.app/v1/codes/qr_a1b2c3d4 \
-H "Authorization: Bearer qr3_sk_..." \
-H "Content-Type: application/json" \
-d '{ "url": "https://neue-zielseite.example.com", "status": "live" }'

Mērķlapa un ārējās saites

Dinamiskiem url kodiem varat iestatīt is_landing_page: true (izveides laikā vai izmantojot PATCH). Skenējot kodu, tā vietā, lai veiktu novirzīšanu, tiks parādīta qr3 mitināta lapa ar koda publiskajiem failiem un ārējām saitēm. Ārējās saites tiek nodotas kā links masīvs:

{
"is_landing_page": true,
"links": [
{ "label": "Datenblatt", "url": "https://example.com/datenblatt.pdf" },
{ "label": "Zertifikat", "url": "https://example.com/zertifikat.pdf" }
]
}
  • 0–20 saites katram kodam; label ir 1–100 rakstzīmes; url jābūt http(s) (≤ 2048 rakstzīmes).
  • Katrs URL tiek pārbaudīts ar Google Web Risk — nedrošs URL atgriež 422.
  • Ja saglabāšanas brīdī Web Risk nav sasniedzams, saite tik un tā tiek pieņemta, taču tiek atzīmēta atkārtotai pārbaudei. Ikdienas fona uzdevums atkārtoti pārbauda saglabātās saites (un regulāri pārbauda arī tās, kas iepriekš klasificētas kā drošas) un automātiski aptur kodu, ja kāda saite vēlāk tiek atzīta par nedrošu.
  • "links": [] dzēš visas saites. Skatiet mērķlapas rokasgrāmatu.

QR koda dzēšana

DELETE /v1/codes/:id

Mīkstā dzēšana (Soft-Delete) — QR kods tiek arhivēts, skenēšanas dati tiek saglabāti.

Terminal window
curl -X DELETE https://qr3.app/v1/codes/qr_a1b2c3d4 \
-H "Authorization: Bearer qr3_sk_..."

QR attēlu lejupielāde

Visi attēlu formāti ir publiski pieejami — autentifikācija nav nepieciešama.

FormātsURLIzmantošana
SVG (vektors)/v1/codes/:code/qr.svgTīmeklis, mērogošana, digitālie mediji
PNG (rasters)/v1/codes/:code/qr.pngE-pasts, prezentācijas
PDF (vektors)/v1/codes/:code/qr.pdfNoklusējums: kvadrātveida (tikai kods); ?format=a4 apdrukājamai lapai
EPS (vektors)/v1/codes/:code/qr.epsProfesionālas drukāšanas darbplūsmas (Adobe, tipogrāfijas)

Izvēles: ?size=N — moduļa izmērs pikseļos (2–20, noklusējums: 4) formātiem SVG, PNG un EPS. PDF izmanto fiksētu moduļa izmēru.

Tikai PDF: ?format=a4|square — lapas formāts (noklusējums: square — tikai kods + klusā zona (Quiet Zone), bez A4 baltā laukuma; a4 drukāšanai gatavai A4 lapai)

Terminal window
# SVG für Web
curl https://qr3.app/v1/codes/r7f3Kx/qr.svg
# PNG in hoher Auflösung
curl https://qr3.app/v1/codes/r7f3Kx/qr.png?size=10 -o qr-hires.png
# Kompaktes PDF (nur der Code, Standard)
curl https://qr3.app/v1/codes/r7f3Kx/qr.pdf -o qr.pdf
# Druckfertiges A4-Blatt
curl "https://qr3.app/v1/codes/r7f3Kx/qr.pdf?format=a4" -o qr-a4.pdf

Komentāri

Komentāri nodrošina atgriezeniskās saites cilpas starp aģentūrām un klientiem.

GET /v1/codes/:id/comments

POST /v1/codes/:id/comments

PATCH /v1/codes/:id/comments/:commentId

DELETE /v1/codes/:id/comments/:commentId

Terminal window
# Kommentar hinzufügen
curl -X POST https://qr3.app/v1/codes/qr_a1b2c3d4/comments \
-H "Authorization: Bearer qr3_sk_..." \
-H "Content-Type: application/json" \
-d '{ "body": "QR-Code bitte auf grünen Hintergrund abstimmen.", "author_name": "Max Müller" }'
# Offene Kommentare auflisten
curl "https://qr3.app/v1/codes/qr_a1b2c3d4/comments?resolved=false" \
-H "Authorization: Bearer qr3_sk_..."
# Kommentar als erledigt markieren
curl -X PATCH https://qr3.app/v1/codes/qr_a1b2c3d4/comments/cmt_xyz \
-H "Authorization: Bearer qr3_sk_..." \
-H "Content-Type: application/json" \
-d '{ "resolved": true }'