Skip to content

Read results ​

Current values ​

Set the API host root, credential and submission ID, then save the data response. These commands use Bash, curl and jq.

sh
API_BASE="https://YOUR_API_HOST"
TOKEN="YOUR_ACCESS_TOKEN"
SUBMISSION_ID="YOUR_SUBMISSION_ID"
curl --fail-with-body --silent --show-error \
  "$API_BASE/v2/submissions/$SUBMISSION_ID/data" \
  -H "Authorization: Bearer $TOKEN" > submission.json
jq '.groups[] | .items[] | {id, field: .formField.name, value, sourceType}' submission.json

Current values are in groups[].items[].value. formGroups[].fields holds field definitions. Each item embeds its formField identity, and sourceType: "manual" identifies a corrected value. Fields and submission values includes the response shape and host mapping.

Poll GET /v2/submissions/{id}/status until status is done. The complete response is:

json
{ "status": "done" }

While processing, it returns {"status":"pending"}. Once done, inspect documents[].status and rejectionReason in the data response before accepting the result. documents[].extractedData holds the original extraction output.

Corrections ​

The widget saves corrections before its event reaches your application. To submit a correction directly, select an item ID from the current values. Send correctedValue as a JSON string, including for number and money fields. Read the current value immediately before saving and send it as extractedValue to preserve the original value in correction history:

sh
: "${API_BASE:?Set the API host root}"
: "${TOKEN:?Set the access token}"
: "${SUBMISSION_ID:?Set the submission ID}"
ITEM_ID="YOUR_ITEM_ID"
CORRECTED_VALUE="1275000"
EXTRACTED_VALUE=$(curl --fail-with-body --silent --show-error \
  "$API_BASE/v2/submissions/$SUBMISSION_ID/data" \
  -H "Authorization: Bearer $TOKEN" | jq -c --arg id "$ITEM_ID" \
  '[.groups[].items[] | select(.id == $id)] |
   if length == 1 then .[0].value else error("Expected one matching item") end')
curl --fail-with-body --silent --show-error -X POST \
  "$API_BASE/v2/submissions/$SUBMISSION_ID/items/$ITEM_ID/corrections" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d "$(jq -n --argjson original "$EXTRACTED_VALUE" --arg corrected "$CORRECTED_VALUE" \
    '{extractedValue:$original,correctedValue:$corrected,feedback:"Verified against the source document"}')"

Read correction history for the submission:

sh
curl --fail-with-body --silent --show-error \
  "$API_BASE/v2/submissions/$SUBMISSION_ID/corrections" \
  -H "Authorization: Bearer $TOKEN"

For one item, use GET /v2/submissions/{id}/items/{itemId}/corrections. Corrections hold feedback and attribution alongside the saved value. A direct item PATCH writes a value; the corrections endpoint adds the review history.

Preserve any required correction history before replacing extraction data, because replacement can remove item versions and repeated groups.

Original document ​

Download the original bytes from a document's signed URL in the data response:

sh
DOCUMENT_URL=$(jq -er '.documents[0].url' submission.json)
curl --fail-with-body --silent --show-error "$DOCUMENT_URL" --output original-document

Use documents[].name and contentType to identify the file. urlExpiry gives the link's expiry, at most one hour after it was issued. Read submission data again to obtain a refreshed URL when needed. The PDF viewer's Download control retrieves the same source file.

For an extraction-specific read, GET /v2/submissions/{id}/extractions/{extractionId} returns document.blobUrl. Refresh an expired link through the submission data endpoint first.

Finalise a submission ​

sh
curl --fail-with-body --silent --show-error -X PATCH \
  "$API_BASE/v2/submissions/$SUBMISSION_ID" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"status":"final"}'

Use {"status":"draft"} to reopen it. Your application controls when to call this operation. Set readOnly on Form to disable edits in the widget.