MostlyQR

Batch

Maak duizenden dynamische links in één aanroep. Batch-creatie is asynchroon: u dient de set in, krijgt onmiddellijk een job_id terug en pollt voor voltooiing. Dezelfde engine en dynamic_codes quota als een enkele creatie. Pro+.

# Een batch indienen

Geef ofwel een JSON links array of een csv string (RFC-4180, headerrij destination_url[,title][,folder]).

bash
curl https://mostlyqr.com/api/v1/batch/links \
  -H "Authorization: Bearer mtq_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "links": [
      { "destination_url": "https://example.com/a", "title": "Flyer A" },
      { "destination_url": "https://example.com/b", "title": "Flyer B" }
    ],
    "folder_id": "fld-spring"
  }'
json
{ "job_id": "7f3a2c9b", "total": 2, "queued": true }

CSV in plaats daarvan:

json
{ "csv": "destination_url,title\nhttps://example.com/a,Flyer A\nhttps://example.com/b,Flyer B" }

# De job pollen

bash
curl https://mostlyqr.com/api/v1/batch/jobs/7f3a2c9b \
  -H "Authorization: Bearer mtq_live_…"
json
{ "job_id": "7f3a2c9b", "status": "done", "total": 2, "created": 2, "progress": 1 }

status is één van queued, running, done, failed. Zodra done, verschijnen de nieuwe links via GET /v1/links.

# Opmerkingen

  • De job is verdeeld en hervatbaar — grote imports zullen de aanvraag niet time-outen.
  • Rijen boven uw dynamic_codes quota worden afgewezen; de job rapporteert per rij errors.
  • Voor een unieke code per fysieke eenheid (niet per bestemming), gebruik geserialiseerde codes in plaats daarvan.

# Volgende