Zum Inhalt springen

Schnellstart

Hier der komplette Roundtrip mit curl. Du brauchst einen API-Key und ein PDF. Exportiere den Key zuerst:

Terminal window
export ACCESSFUL_API_KEY="ak_dein_key_hier"
export BASE="https://api.accessful.de/api/v1/upload-service"
  1. PDF hochladen. Sende es als Multipart-Feld files:

    Terminal window
    curl --fail-with-body --silent --show-error \
    -X POST "$BASE/pdf/upload" \
    -H "X-API-Key: $ACCESSFUL_API_KEY" \
    -F "files=@dokument.pdf"

    Die Antwort listet eine caseId pro akzeptierter Datei:

    {
    "successfulUploads": ["7c2f1e4a-9b0d-4a1e-8f3c-2d6b5a9e1c40"],
    "duplicateFiles": [],
    "message": "Upload completed successfully. Uploaded 1 files. 0 duplicates found.",
    "callbackUrl": null
    }
  2. Job-Status pollen mit dieser caseId, bis er completed ist:

    Terminal window
    curl --fail-with-body --silent --show-error \
    "$BASE/job-status/7c2f1e4a-9b0d-4a1e-8f3c-2d6b5a9e1c40" \
    -H "X-API-Key: $ACCESSFUL_API_KEY"
    { "jobStatus": "completed", "stage": "finished", "score": 87 }

    score ist die Barrierefreiheits-Qualität des Ergebnisses (0–100). Siehe alle jobStatus-Werte.

  3. Herunterladen des konvertierten PDF/UA:

    Terminal window
    curl --fail-with-body --silent --show-error --location \
    "$BASE/download/7c2f1e4a-9b0d-4a1e-8f3c-2d6b5a9e1c40" \
    -H "X-API-Key: $ACCESSFUL_API_KEY" \
    -o dokument-pdfua.pdf
  4. Case löschen, wenn du ihn nicht mehr brauchst (optional, aber empfohlen — dies ist eine endgültige Löschung):

    Terminal window
    curl --fail-with-body --silent --show-error \
    -X DELETE "$BASE/delete/7c2f1e4a-9b0d-4a1e-8f3c-2d6b5a9e1c40" \
    -H "X-API-Key: $ACCESSFUL_API_KEY"
#!/usr/bin/env bash
set -euo pipefail
# Requires curl and jq. Pass a PDF path as the first argument.
: "${ACCESSFUL_API_KEY:?Set ACCESSFUL_API_KEY first}"
BASE="https://api.accessful.de/api/v1/upload-service"
FILE="${1:-document.pdf}"
AUTH=(-H "X-API-Key: $ACCESSFUL_API_KEY")
upload=$(curl --fail-with-body --silent --show-error \
-X POST "$BASE/pdf/upload" \
"${AUTH[@]}" \
-F "files=@$FILE")
case_id=$(jq -er '.successfulUploads[0]' <<<"$upload")
echo "Uploaded: $case_id"
terminal='^(completed|failed|analyzer_failed|canceled|quota_exceeded)$'
while true; do
status_json=$(curl --fail-with-body --silent --show-error \
"$BASE/job-status/$case_id" "${AUTH[@]}")
status=$(jq -r '.jobStatus' <<<"$status_json")
echo "Status: $status"
[[ $status =~ $terminal ]] && break
sleep 2
done
if [[ $status != completed ]]; then
echo "Conversion ended with status: $status" >&2
exit 1
fi
curl --fail-with-body --silent --show-error --location \
"$BASE/download/$case_id" \
"${AUTH[@]}" \
--output document-pdfua.pdf
score=$(jq -r '.score // "n/a"' <<<"$status_json")
echo "Saved document-pdfua.pdf (score: $score)"

Lieber klicken statt tippen? Führe denselben Ablauf im Browser auf der Seite Live testen aus.