Skip to content

Run a document template against a sample

POST
/v1/extraction-templates/prove
curl --request POST \
--url http://localhost:8080/v1/extraction-templates/prove \
--header 'Content-Type: application/json' \
--data '{ "sampleId": "example", "template": "example" }'

Takes sampleId and a template ({ docType, title?, keywords?, rules }), validates it, and classifies and extracts the sample with only that template in play; the response carries how the sample classified and every value read with its page and box, for a person to check on the page before saving. Administrators only.

Media typeapplication/json

Body of POST /v1/extraction-templates/prove: a document template to run against an uploaded sample.

object
sampleId
string
template
Examplegenerated
{
"sampleId": "example",
"template": "example"
}

OK

Media typeapplication/json

A proposal and its proof: the suggested document template, how the sample classifies with it, and what it extracts.

object
template
required
classifiedAs
required
string
confidence
required
number | string format: double
/^-?(?:0|[1-9]\d*)(?:\.\d+)?$/
fields
required
Array<object>
object
fieldName
required
string
rawText
required
null | string
normalizedValue
required
null | string
valueKind
required
string
pageNo
required
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
bbox
required
One of:
null
confidence
required
number | string format: double
/^-?(?:0|[1-9]\d*)(?:\.\d+)?$/
method
required
string
engineVersion
required
string
Examplegenerated
{
"template": "example",
"classifiedAs": "example",
"confidence": 1,
"fields": [
{
"fieldName": "example",
"rawText": "example",
"normalizedValue": "example",
"valueKind": "example",
"pageNo": 1,
"bbox": {
"x": 1,
"y": 1,
"w": 1,
"h": 1
},
"confidence": 1,
"method": "example"
}
],
"engineVersion": "example"
}