Run a document template against a sample
POST
/v1/extraction-templates/prove
const url = 'http://localhost:8080/v1/extraction-templates/prove';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"sampleId":"example","template":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Request Bodyrequired
Section titled “Request Bodyrequired”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"}Responses
Section titled “Responses”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
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
bbox
required
confidence
required
number | string format: double
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"}