Skip to main content
Synchronous extraction processes a document in a single request–response cycle. The connection remains open until the extraction process completes and the full response is returned.

Endpoint

https://smartsense-dev-api.nostello.com/api/v1/extractFields

Request Header

All requests must include an API key in the Authorization header.
KeyValue
Authorizationapi-key [your api key]

Request Body

The request must be sent as multipart/form-data.

Document Source

KeyTypeValue
fileFile[binary file upload]
The file is compulsory when sending requests.

Extraction Options

KeyTypeDefaultValue
templateNameText[template name]
filterNameText[filter name]
documentSplittingTextfalsetrue/false
returnDocumentsTextfalsetrue/false
returnTextTextfalsetrue/false
schemaChunkingTextautoauto/combined
passwordText[password]

Request Example

curl --location 'https://smartsense-dev-api.nostello.com/api/v1/extractFields' \
--header 'Authorization: api-key opt_ede920076469_M8M9wr6WnmlvM05iiz6Rqxlr9yG-X8WjItmmqzIp03A' \
--form 'file=@"[file path]"' \
--form 'templateName="[template name]"' \
--form 'filterName=""' \
--form 'documentSplitting="false"' \
--form 'returnDocuments="false"' \
--form 'returnText="false"' \
--form 'schemaChunking="auto"' \
--form 'password=""'

Response Example

Below is an example of a success response.
{
    "success": true,
    "data": {
        "completionTime": 48.94,
        "originalName": "[document name]",
        "processedPages": 1,
        "documents": [
            {
                "extracted": true,
                "averageDocumentConfidence": 94.32,
                "sourcePages": [
                    1
                ],
                "usedTemplateName": "[template name]",
                "content": {
                    "[field 1]": {
                        "value": "[field value]",
                        "confidence": 99.93,
                        "page": 1,
                        "boundingBox": {
                            "top": 0.24541398882865906,
                            "left": 0.7629675269126892,
                            "width": 0.03504106402397156,
                            "height": 0.007880417630076408
                        }
                    },
                    "[field 2]": {
                        "value": "[field value]",
                        "confidence": 99.02,
                        "page": 1,
                        "boundingBox": {
                            "top": 0.195048987865448,
                            "left": 0.7912929654121399,
                            "width": 0.04586394503712654,
                            "height": 0.007497004698961973
                        }
                    }
                },
                "returnedText": "[text blob]",
				"returnedDocumentBase64": "[Base 64]"
            }
        ]
    }
}
FieldTypeValuesDescription
successBooleantrue/falseIndicates the success or failure of the request as a whole.
dataObjects-Contains all of the data relating to the request.
completionTimeDecimal≥ 0The time it took to process the entire request.
originalNameString-The name of the original document sent in the request.
processedPagesWhole Number≥ 0The total number of pages processed that the original document contained.
documentsArray-Contains the information relating to each document extracted. When document splitting is on, then there will be multiple document objects.
extractedBooleantrue/falseIndicates whether the document was extracted. When there is a filter in the extraction process, some documents will be false and not extracted depending on the rules specified in the filter.
averageDocumentConfidenceDecimal0–100Indicates the average confidence across all fields extracted from the document expressed as a percentage.
sourcePagesArraypage numbersPages from which this document was extracted
usedTemplateNameString-The template used to extract the document.
contentObjectfield-name → objectThis holds the information relating to each field extracted.
valueString-The value of the field extracted.
confidenceDecimal0–100The confidence value for that specific extracted field.
pageWhole Number≥ 1The page from where the document was extracted.
boundingBoxObjects-The 4 coordinates creating the box that surrounds the information extracted.
returnedTextString-Contains the text blob of all the text found on the document.
returnedDocumentBase64StringBase64Base64-encoded PDF document